Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
  • abdsaber000/vlc
  • falbrechtskirchinger/vlc
  • b.sullender/vlc
  • hulxv/vlc
  • zyad-ayad/vlc
  • shocknovaa/vlc
  • gremlinflat/vlc
  • Pratham24D/vlc
411 results
Show changes
Commits on Source (16)
Showing
with 64 additions and 84 deletions
......@@ -118,7 +118,7 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
/* skip aiff header */
if( vlc_stream_Read( p_demux->s, NULL, 12 ) < 12 )
if( vlc_stream_Read( p_demux->s, NULL, 12 ) != 12 )
return VLC_EGENERIC;
/* Fill p_demux field */
......
......@@ -70,12 +70,6 @@ static inline int GetValue2b(uint32_t *var, const uint8_t *p, unsigned int *skip
}
}
static uint32_t SkipBytes( stream_t *s, uint32_t i_bytes )
{
ssize_t i_read = vlc_stream_Read( s, NULL, i_bytes );
return i_read > 0 ? (uint32_t) i_read : 0;
}
static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
uint8_t i_stream_number, asf_track_info_t *p_tkinfo,
uint32_t i_sub_payload_data_length, vlc_tick_t i_pts, vlc_tick_t i_dts,
......@@ -93,8 +87,7 @@ static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
{
vlc_debug(p_packetsys->logger, "dropping duplicate num %"PRIu32" off %"PRIu32,
i_media_object_number , i_media_object_offset);
ssize_t skipped = vlc_stream_Read( p_packetsys->s, NULL, i_sub_payload_data_length );
return ( skipped >= 0 && (uint32_t) skipped == i_sub_payload_data_length ) ? 0 : -1;
return vlc_stream_Read( p_packetsys->s, NULL, i_sub_payload_data_length ) != i_sub_payload_data_length ? -1 : 0;
}
}
......@@ -356,7 +349,11 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
goto skip;
}
SkipBytes( p_packetsys->s, pkt->i_skip );
if (pkt->i_skip && vlc_stream_Read( p_packetsys->s, NULL, pkt->i_skip ) != pkt->i_skip )
{
vlc_warning( p_packetsys->logger, "unexpected end of file" );
return -1;
}
vlc_tick_t i_payload_pts;
i_payload_pts = i_pkt_time + i_pkt_time_delta * i_subpayload_count;
......@@ -527,7 +524,7 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
if( pkt.left > 0 )
{
size_t toskip;
uint32_t toskip;
if( pkt.left > pkt.padding_length &&
!p_packetsys->b_can_hold_multiple_packets )
{
......@@ -550,14 +547,10 @@ int DemuxASFPacket( asf_packet_sys_t *p_packetsys,
toskip = pkt.padding_length;
}
if( toskip )
if( toskip && vlc_stream_Read( p_packetsys->s, NULL, toskip ) != toskip )
{
i_return = vlc_stream_Read( p_packetsys->s, NULL, toskip );
if( i_return < 0 || (size_t) i_return < toskip )
{
vlc_error( p_packetsys->logger, "cannot skip data, EOF ?" );
return 0;
}
vlc_error( p_packetsys->logger, "cannot skip data, EOF ?" );
return 0;
}
}
......@@ -570,8 +563,7 @@ loop_error_recovery:
vlc_error( p_packetsys->logger, "unsupported packet header, fatal error" );
return -1;
}
i_return = vlc_stream_Read( p_packetsys->s, NULL, i_data_packet_min );
if( i_return <= 0 || (size_t) i_return != i_data_packet_min )
if( vlc_stream_Read( p_packetsys->s, NULL, i_data_packet_min ) != i_data_packet_min )
{
vlc_warning( p_packetsys->logger, "cannot skip data, EOF ?" );
return 0;
......
......@@ -113,7 +113,7 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
/* skip signature */
if( vlc_stream_Read( p_demux->s, NULL, 4 ) < 4 )
if( vlc_stream_Read( p_demux->s, NULL, 4 ) != 4 )
return VLC_EGENERIC;
/* read header */
......@@ -143,8 +143,8 @@ static int Open( vlc_object_t *p_this )
if( p_sys->i_header_size > SSIZE_MAX )
return VLC_EGENERIC;
#endif
size_t skip = p_sys->i_header_size - 24;
if( vlc_stream_Read( p_demux->s, NULL, skip ) < (ssize_t)skip )
uint32_t skip = p_sys->i_header_size - 24;
if( vlc_stream_Read( p_demux->s, NULL, skip ) != skip )
return VLC_EGENERIC;
}
......
......@@ -332,8 +332,7 @@ static int Open( vlc_object_t * p_this )
return VLC_EGENERIC;
}
if( i_peeker > 0
&& vlc_stream_Read( p_demux->s, NULL, i_peeker ) < i_peeker )
if( i_peeker > 0 && vlc_stream_Read( p_demux->s, NULL, i_peeker ) != i_peeker )
return VLC_EGENERIC;
/* Initialize input structures. */
......@@ -833,7 +832,7 @@ aviindex:
goto error;
}
/* Skip movi header */
if( vlc_stream_Read( p_demux->s, NULL, 12 ) < 12 )
if( vlc_stream_Read( p_demux->s, NULL, 12 ) != 12 )
goto error;
p_sys->i_movi_begin = p_movi->i_chunk_pos;
......@@ -2225,7 +2224,7 @@ static int AVI_PacketGetHeader( demux_t *p_demux, avi_packet_t *p_pk )
static int AVI_PacketNext( demux_t *p_demux )
{
avi_packet_t avi_ck;
size_t i_skip = 0;
uint32_t i_skip = 0;
if( AVI_PacketGetHeader( p_demux, &avi_ck ) )
{
......@@ -2252,8 +2251,7 @@ static int AVI_PacketNext( demux_t *p_demux )
if( i_skip > SSIZE_MAX )
return VLC_EGENERIC;
ssize_t i_ret = vlc_stream_Read( p_demux->s, NULL, i_skip );
if( i_ret < 0 || (size_t) i_ret != i_skip )
if( vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
{
return VLC_EGENERIC;
}
......
......@@ -114,12 +114,10 @@ static int AVI_GotoNextChunk( stream_t *s, const avi_chunk_t *p_chk )
{
return vlc_stream_Seek( s, i_offset );
}
else
{
ssize_t i_read = i_offset - vlc_stream_Tell( s );
return (i_read >=0 && vlc_stream_Read( s, NULL, i_read ) == i_read) ?
VLC_SUCCESS : VLC_EGENERIC;
}
ssize_t i_read = i_offset - vlc_stream_Tell( s );
if (i_read < 0)
return VLC_EGENERIC;
return vlc_stream_Read( s, NULL, i_read ) != i_read ? VLC_EGENERIC : VLC_SUCCESS;
}
static int AVI_NextChunk( stream_t *s, avi_chunk_t *p_chk )
......
......@@ -817,7 +817,7 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
}
if( vlc_stream_Read( p_demux->s, NULL, 8 ) < 8 )
if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 )
return VLC_EGENERIC; /* This would be very strange since we justed peeked at these bytes. */
p_demux->p_sys = calloc( 1, sizeof( demux_sys_t ));
......
......@@ -450,7 +450,7 @@ static int Open(vlc_object_t *obj)
sys->length = VLC_TICK_INVALID;
offset -= hdrlen;
if (vlc_stream_Read(stream, NULL, offset) < (ssize_t)offset)
if (vlc_stream_Read(stream, NULL, offset) != offset)
return VLC_EGENERIC;
}
......
......@@ -705,7 +705,7 @@ static int ParseHeaders( demux_t *p_demux, es_format_t *p_fmt )
if( p_fmt->p_extra == NULL )
return VLC_EGENERIC;
if( vlc_stream_Read( p_demux->s, NULL, 4) < 4)
if( vlc_stream_Read( p_demux->s, NULL, 4 ) != 4 )
{
FREENULL( p_fmt->p_extra );
return VLC_EGENERIC;
......@@ -751,7 +751,7 @@ static int ParseHeaders( demux_t *p_demux, es_format_t *p_fmt )
ParsePicture( p_demux, p_peek, i_peek );
}
if( vlc_stream_Read( p_demux->s, NULL, 4+i_len ) < 4+i_len )
if( vlc_stream_Read( p_demux->s, NULL, 4+i_len ) != (4+i_len) )
break;
}
......
......@@ -339,7 +339,7 @@ static int Open( vlc_object_t * p_this )
if( b_matched )
{
p_demux->pf_demux = MimeDemux;
if( vlc_stream_Read( p_demux->s, NULL, i_size ) < i_size )
if( vlc_stream_Read( p_demux->s, NULL, i_size ) != i_size )
return VLC_EGENERIC;
}
else if( i_size == 0 )
......
......@@ -251,13 +251,13 @@ int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
if ( i_current_pos < 0 || i_pos < (uint64_t)i_current_pos )
return VLC_EGENERIC;
size_t i_toread = i_pos - i_current_pos;
uint64_t i_toread = i_pos - i_current_pos;
if( i_toread == 0 )
return VLC_SUCCESS;
else if( i_toread > (1<<17) )
return VLC_EGENERIC;
if( vlc_stream_Read( p_stream, NULL, i_toread ) != (ssize_t)i_toread )
if( vlc_stream_Read( p_stream, NULL, i_toread ) != i_toread )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
......@@ -630,7 +630,7 @@ static int MP4_ReadBoxSkip( stream_t *p_stream, MP4_Box_t *p_box )
static int MP4_ReadBox_ilst( stream_t *p_stream, MP4_Box_t *p_box )
{
if( p_box->i_size < 8 || vlc_stream_Read( p_stream, NULL, 8 ) < 8 )
if( p_box->i_size < 8 || vlc_stream_Read( p_stream, NULL, 8 ) != 8 )
return 0;
/* Find our handler */
......@@ -3758,7 +3758,7 @@ static int MP4_ReadBox_Metadata( stream_t *p_stream, MP4_Box_t *p_box )
const uint8_t *p_peek;
if ( vlc_stream_Peek( p_stream, &p_peek, 16 ) < 16 )
return 0;
if ( vlc_stream_Read( p_stream, NULL, 8 ) < 8 )
if ( vlc_stream_Read( p_stream, NULL, 8 ) != 8 )
return 0;
const uint32_t stoplist[] = { ATOM_data, 0 };
return MP4_ReadBoxContainerChildren( p_stream, p_box, stoplist );
......@@ -3930,7 +3930,7 @@ static int MP4_ReadBox_TrackReference( stream_t *p_stream, MP4_Box_t *p_box )
static int MP4_ReadBox_tref( stream_t *p_stream, MP4_Box_t *p_box )
{
/* skip header */
ssize_t i_header = mp4_box_headersize( p_box );
size_t i_header = mp4_box_headersize( p_box );
if( vlc_stream_Read( p_stream, NULL, i_header ) != i_header )
return 0;
/* read each reference atom with forced handler */
......@@ -4064,7 +4064,7 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
return 0;
/* skip over box header */
if( vlc_stream_Read( p_stream, NULL, i_headersize ) < (ssize_t) i_headersize )
if( vlc_stream_Read( p_stream, NULL, i_headersize ) != i_headersize )
return 0;
/* meta content starts with a 4 byte version/flags value (should be 0) */
......@@ -4073,7 +4073,7 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
if( !memcmp( p_peek, "\0\0\0", 4 ) ) /* correct header case */
{
if( vlc_stream_Read( p_stream, NULL, 4 ) < 4 )
if( vlc_stream_Read( p_stream, NULL, 4 ) != 4 )
return 0;
}
else if( memcmp( &p_peek[4], "hdlr", 4 ) ) /* Broken, headerless ones */
......
......@@ -151,7 +151,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
const uint8_t *p_peek;
ssize_t i_peek = 0;
ssize_t i_offset = 0;
ssize_t i_skip = 0;
uint64_t i_skip = 0;
unsigned i_max_packets = PS_PACKET_PROBE;
int format = MPEG_PS;
int i_mux_rate = 0;
......@@ -220,7 +220,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
i_offset += i_pessize;
}
if( i_skip > 0 && !p_demux->b_preparsing &&
if( i_skip && !p_demux->b_preparsing &&
vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
return VLC_EGENERIC;
......@@ -865,8 +865,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
static int ps_pkt_resynch( stream_t *s, int format, bool b_pack )
{
const uint8_t *p_peek;
int i_peek;
int i_skip;
ssize_t i_peek;
unsigned int i_skip;
if( vlc_stream_Peek( s, &p_peek, 4 ) < 4 )
{
......@@ -909,14 +909,14 @@ static int ps_pkt_resynch( stream_t *s, int format, bool b_pack )
p_peek[3] >= PS_STREAM_ID_END_STREAM &&
( !b_pack || p_peek[3] == PS_STREAM_ID_PACK_HEADER ) )
{
return vlc_stream_Read( s, NULL, i_skip ) == i_skip ? 1 : -1;
return vlc_stream_Read( s, NULL, i_skip ) != i_skip ? -1 : 1;
}
p_peek++;
i_peek--;
i_skip++;
}
return vlc_stream_Read( s, NULL, i_skip ) == i_skip ? 0 : -1;
return vlc_stream_Read( s, NULL, i_skip ) != i_skip ? -1 : 0;
}
static block_t *ps_pkt_read( stream_t *s )
......
......@@ -187,7 +187,7 @@ static int Demux( demux_t *p_demux )
else if( GetWLE( p_peek ) == 0xbeef )
{
/* Next frame of the current NSVs chunk */
if( vlc_stream_Read( p_demux->s, NULL, 2 ) < 2 )
if( vlc_stream_Read( p_demux->s, NULL, 2 ) != 2 )
{
msg_Warn( p_demux, "cannot read" );
return VLC_DEMUXER_EOF;
......@@ -241,7 +241,7 @@ static int Demux( demux_t *p_demux )
if( p_sys->p_sub )
es_out_Control( p_demux->out, ES_OUT_SET_ES, p_sys->p_sub );
}
if( vlc_stream_Read( p_demux->s, NULL, 2 ) < 2 )
if( vlc_stream_Read( p_demux->s, NULL, 2 ) != 2 )
return VLC_DEMUXER_EOF;
if( ( p_frame = vlc_stream_Block( p_demux->s, i_aux - 2 ) ) )
......@@ -271,7 +271,7 @@ static int Demux( demux_t *p_demux )
else
{
/* We skip this extra data */
if( vlc_stream_Read( p_demux->s, NULL, i_aux ) < i_aux )
if( vlc_stream_Read( p_demux->s, NULL, i_aux ) != i_aux )
{
msg_Warn( p_demux, "cannot read" );
return VLC_DEMUXER_EOF;
......@@ -464,8 +464,7 @@ static int ReSynch( demux_t *p_demux )
if( !memcmp( p_peek, "NSVf", 4 )
|| !memcmp( p_peek, "NSVs", 4 ) )
{
if( i_skip > 0
&& vlc_stream_Read( p_demux->s, NULL, i_skip ) < i_skip )
if( i_skip > 0 && vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
......@@ -473,7 +472,7 @@ static int ReSynch( demux_t *p_demux )
i_skip++;
}
if( vlc_stream_Read( p_demux->s, NULL, i_skip ) < i_skip )
if( vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
break;
}
return VLC_EGENERIC;
......@@ -502,8 +501,7 @@ static int ReadNSVf( demux_t *p_demux )
if( i_header_size > SSIZE_MAX )
return VLC_EGENERIC;
#endif
if ( vlc_stream_Read( p_demux->s, NULL, i_header_size )
< (ssize_t)i_header_size )
if ( vlc_stream_Read( p_demux->s, NULL, i_header_size ) != i_header_size )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
......
......@@ -259,8 +259,7 @@ static int Open( vlc_object_t * p_this )
else
{
msg_Warn( p_demux, "unsupported 'D' frame (c=%c)", fh.i_compression );
if( vlc_stream_Read( p_demux->s, NULL,
fh.i_length ) != fh.i_length )
if( vlc_stream_Read( p_demux->s, NULL, fh.i_length ) != fh.i_length )
goto error;
}
}
......@@ -380,8 +379,7 @@ static int Demux( demux_t *p_demux )
if( fh.i_type != 'R' && fh.i_length > 0 )
{
if( vlc_stream_Read( p_demux->s, NULL,
fh.i_length ) != fh.i_length )
if( vlc_stream_Read( p_demux->s, NULL, fh.i_length ) != fh.i_length )
return VLC_DEMUXER_EGENERIC;
}
}
......@@ -609,8 +607,7 @@ static int ControlSetPosition(demux_t *p_demux, uint64_t offset, bool b_guess)
if( fh.i_type != 'R' && fh.i_length > 0 )
{
if( vlc_stream_Read( p_demux->s, NULL,
fh.i_length ) != fh.i_length )
if( vlc_stream_Read( p_demux->s, NULL, fh.i_length ) != fh.i_length )
return VLC_EGENERIC;
}
}
......
......@@ -60,7 +60,7 @@ int Import_M3U( vlc_object_t *p_this )
stream_t *p_stream = (stream_t *)p_this;
const uint8_t *p_peek;
ssize_t i_peek;
int offset = 0;
unsigned int offset = 0;
i_peek = vlc_stream_Peek( p_stream->s, &p_peek, 1024 );
if( i_peek < 8 )
......@@ -109,7 +109,7 @@ int Import_M3U( vlc_object_t *p_this )
if (!match)
return VLC_EGENERIC;
if (offset > 0 && vlc_stream_Read(p_stream->s, NULL, offset) < offset)
if (offset && vlc_stream_Read(p_stream->s, NULL, offset) != offset)
return VLC_EGENERIC;
msg_Dbg( p_stream, "found valid M3U playlist" );
......
......@@ -278,7 +278,7 @@ static int Demux( demux_t *p_demux )
default:
msg_Warn( p_demux, "unknown id=0x%x", p_peek[2] );
if( vlc_stream_Read( p_demux->s, NULL, i_size + 8 ) < i_size + 8 )
if( vlc_stream_Read( p_demux->s, NULL, i_size + 8 ) != (i_size + 8) )
return VLC_DEMUXER_EOF;
break;
}
......@@ -377,7 +377,7 @@ static int ReSynch( demux_t *p_demux )
if( p_peek[0] == 'A' && p_peek[1] == 'V' && p_peek[4] == 0x55 )
{
if( i_skip > 0
&& vlc_stream_Read( p_demux->s, NULL, i_skip ) < i_skip )
&& vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
......@@ -385,7 +385,7 @@ static int ReSynch( demux_t *p_demux )
i_skip++;
}
if( vlc_stream_Read( p_demux->s, NULL, i_skip ) < i_skip )
if( vlc_stream_Read( p_demux->s, NULL, i_skip ) != i_skip )
break;
}
......
......@@ -398,7 +398,7 @@ static int Demux( demux_t *p_demux )
{
/* Skip the frame header */
/* Skip "FRAME" */
if( vlc_stream_Read( p_demux->s, NULL, 5 ) < 5 )
if( vlc_stream_Read( p_demux->s, NULL, 5 ) != 5 )
return VLC_DEMUXER_EOF;
/* Find \n */
for( ;; )
......
......@@ -555,7 +555,7 @@ static int Open (vlc_object_t *obj)
uint32_t riff_len = GetDWLE (peek + 4);
msg_Dbg (demux, "detected RIFF MIDI file (%"PRIu32" bytes)", riff_len);
if ((vlc_stream_Read (stream, NULL, 12) < 12))
if (vlc_stream_Read( stream, NULL, 12 ) != 12 )
return VLC_EGENERIC;
/* Look for the RIFF data chunk */
......@@ -577,7 +577,7 @@ static int Open (vlc_object_t *obj)
if (!memcmp (chnk_hdr, "data", 4))
break; /* found! */
if (vlc_stream_Read (stream, NULL, chnk_len) < (ssize_t)chnk_len)
if (vlc_stream_Read( stream, NULL, chnk_len ) != chnk_len )
return VLC_EGENERIC;
}
......@@ -640,7 +640,7 @@ static int Open (vlc_object_t *obj)
return VLC_ENOMEM;
/* We've had a valid SMF header - now skip it*/
if (vlc_stream_Read (stream, NULL, 14) < 14)
if (vlc_stream_Read( stream, NULL, 14 ) != 14 )
goto error;
demux->p_sys = sys;
......
......@@ -1661,8 +1661,7 @@ static int parse_master(demux_t *p_demux)
p_sys->seq_table[j].l_timestamp = U64_AT(&mst_buf[0]);
if (i_map_size > 8) {
msg_Err(p_demux, "Unsupported SEQ bitmap size in master chunk");
if (vlc_stream_Read(p_demux->s, NULL, i_map_size)
< (ssize_t)i_map_size)
if (vlc_stream_Read(p_demux->s, NULL, i_map_size) != i_map_size )
return VLC_EGENERIC;
} else {
if (vlc_stream_Read(p_demux->s, mst_buf + 8, i_map_size)
......
......@@ -104,7 +104,7 @@ static int Open( vlc_object_t * p_this )
i_version & 0xff );
/* skip VOC header */
if( vlc_stream_Read( p_demux->s, NULL, i_data_offset ) < i_data_offset )
if( vlc_stream_Read( p_demux->s, NULL, i_data_offset ) != i_data_offset )
return VLC_EGENERIC;
demux_sys_t *p_sys = vlc_obj_malloc( p_this, sizeof (*p_sys) );
......@@ -347,7 +347,7 @@ static int ReadBlockHeader( demux_t *p_demux )
i_block_size -= 12;
if( ( vlc_stream_Read( p_demux->s, buf, 8 ) < 8 )
|| ( vlc_stream_Read( p_demux->s, NULL, 4 ) < 4 ) )
|| vlc_stream_Read( p_demux->s, NULL, 4 ) != 4 )
goto corrupt;
new_fmt.audio.i_rate = GetDWLE( buf );
......@@ -419,8 +419,7 @@ static int ReadBlockHeader( demux_t *p_demux )
/* fall through */
case 4: /* blocks of non-audio types can be skipped */
case 5:
if( vlc_stream_Read( p_demux->s, NULL,
i_block_size ) < i_block_size )
if(vlc_stream_Read( p_demux->s, NULL, i_block_size ) != i_block_size)
goto corrupt;
i_block_size = 0;
break;
......
......@@ -185,8 +185,7 @@ static int ChunkSkip( demux_t *p_demux, uint32_t i_size )
vlc_stream_Tell( p_demux->s ) + i_size );
}
ssize_t i_ret = vlc_stream_Read( p_demux->s, NULL, i_size );
return i_ret < 0 || (size_t) i_ret != i_size ? VLC_EGENERIC : VLC_SUCCESS;
return vlc_stream_Read( p_demux->s, NULL, i_size ) != i_size ? VLC_EGENERIC : VLC_SUCCESS;
}
static int ChunkGetNext( demux_t *p_demux, enum wav_chunk_id *p_id,
......