summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-24 10:19:41 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-24 10:19:41 +0000
commit4402f7d0897a1b26b6085cc00d5a168396637c30 (patch)
treed1355054406baff7f4807da4993b16ed69caf6a9 /libmpdemux
parentf23e43ba3f9e57150aea8dc7d7763e9efad182f0 (diff)
downloadmpv-4402f7d0897a1b26b6085cc00d5a168396637c30.tar.bz2
mpv-4402f7d0897a1b26b6085cc00d5a168396637c30.tar.xz
10l, avoid crash on invalid subtitle id
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22333 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index c5d3953618..d0849da0f1 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -2155,9 +2155,11 @@ if(trak->pos==0 && trak->stream_header_len>0){
++trak->pos;
- if (demuxer->sub->id >= 0) {
- int samplenr = 0;
+ trak = NULL;
+ if (demuxer->sub->id >= 0 && demuxer->sub->id < priv->track_db)
trak = priv->tracks[demuxer->sub->id];
+ if (trak) {
+ int samplenr = 0;
while (samplenr < trak->samples_size) {
double subpts = (double)trak->samples[samplenr].pts / (double)trak->timescale;
if (subpts >= pts) break;