summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_real.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-04-15 21:09:29 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-04-15 21:09:29 +0000
commit97efe20cd11b7c1fd4dc639a3875d590c97ad216 (patch)
tree054fb9547988078c1790aac7b8a684e936f3375d /libmpdemux/demux_real.c
parent02c0f0258f05dcd42499a221b795924e3d4c90c2 (diff)
downloadmpv-97efe20cd11b7c1fd4dc639a3875d590c97ad216.tar.bz2
mpv-97efe20cd11b7c1fd4dc639a3875d590c97ad216.tar.xz
always cast stream IDs to unsigned before comparing to MAX_STREAMS.
just defining them as unsigned might be a better fix though... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18107 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_real.c')
-rw-r--r--libmpdemux/demux_real.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c
index 9cdd041caf..d65122feba 100644
--- a/libmpdemux/demux_real.c
+++ b/libmpdemux/demux_real.c
@@ -162,7 +162,7 @@ static void dump_index(demuxer_t *demuxer, int stream_id)
if ( mp_msg_test(MSGT_DEMUX,MSGL_V) )
return;
- if (stream_id >= MAX_STREAMS)
+ if ((unsigned)stream_id >= MAX_STREAMS)
return;
index = priv->index_table[stream_id];
@@ -1040,7 +1040,7 @@ got_video:
return 1;
}
-if(stream_id<MAX_STREAMS){
+if((unsigned)stream_id<MAX_STREAMS){
if(demuxer->audio->id==-1 && demuxer->a_streams[stream_id]){
sh_audio_t *sh = demuxer->a_streams[stream_id];
@@ -1635,14 +1635,14 @@ static demuxer_t* demux_open_real(demuxer_t* demuxer)
priv->is_multirate = 1;
stream_skip(demuxer->stream, 4); // Length of codec data (repeated)
stream_cnt = stream_read_dword(demuxer->stream); // Get number of audio or video streams
- if (stream_cnt >= MAX_STREAMS) {
+ if ((unsigned)stream_cnt >= MAX_STREAMS) {
mp_msg(MSGT_DEMUX,MSGL_ERR,"Too many streams in %s. Big troubles ahead.\n", mimet);
goto skip_this_chunk;
}
for (i = 0; i < stream_cnt; i++)
stream_list[i] = stream_read_word(demuxer->stream);
for (i = 0; i < stream_cnt; i++)
- if (stream_list[i] >= MAX_STREAMS) {
+ if ((unsigned)stream_list[i] >= MAX_STREAMS) {
mp_msg(MSGT_DEMUX,MSGL_ERR,"Stream id out of range: %d. Ignored.\n", stream_list[i]);
stream_skip(demuxer->stream, 4); // Skip DATA offset for broken stream
} else {