summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-17 08:26:07 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-17 08:26:07 +0000
commitb6e735fde1d1a947383a4182e14a76efa0f5944f (patch)
tree07a1d528d00b0131dd233c5d044042bf94a9cc49 /command.c
parent90f1c3cc920e61de7537dc445f2200c9886f22c4 (diff)
downloadmpv-b6e735fde1d1a947383a4182e14a76efa0f5944f.tar.bz2
mpv-b6e735fde1d1a947383a4182e14a76efa0f5944f.tar.xz
Make sure we do not access demuxer->s_streams out of bounds
when invalid -sid is given git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23568 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r--command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/command.c b/command.c
index 5466176741..77a30c1ad8 100644
--- a/command.c
+++ b/command.c
@@ -1257,14 +1257,16 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
if (mpctx->stream->type != STREAMTYPE_DVD
&& mpctx->stream->type != STREAMTYPE_DVDNAV) {
int i = 0;
+ d_sub->sh = NULL;
for (d_sub->id = 0; d_sub->id < MAX_S_STREAMS; d_sub->id++) {
if (mpctx->demuxer->s_streams[d_sub->id]) {
- if (i == dvdsub_id)
+ if (i == dvdsub_id) {
+ d_sub->sh = mpctx->demuxer->s_streams[d_sub->id];
break;
+ }
i++;
}
}
- d_sub->sh = mpctx->demuxer->s_streams[d_sub->id];
}
if (mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA)
d_sub->id = demux_mkv_change_subs(mpctx->demuxer, dvdsub_id);