summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2013-10-20 21:23:43 +0200
committerClément Bœsch <u@pkh.me>2013-10-20 21:23:46 +0200
commit4189fe11ffcbdcd311eb9a3437586a94492c4cde (patch)
treeb20cd31013e11aa139f8facdbd54f7dfff257ef0 /libavformat/mpeg.c
parentfed483f188b3cd50d25068d74bda00b4f12f5fc8 (diff)
avformat/vobsub: fix invalid sub queue access while seeking.
If there is only 1 stream and seek isn't called with a specific stream index, we pick the first (and only) one. Regression since dbfe6110. Fixes CID1108591.
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 64c5a4ff2a..1ea58d5ed5 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -916,6 +916,8 @@ static int vobsub_read_seek(AVFormatContext *s, int stream_index,
return ret;
}
+ if (stream_index == -1) // only 1 stream
+ stream_index = 0;
return ff_subtitles_queue_seek(&vobsub->q[stream_index], s, stream_index,
min_ts, ts, max_ts, flags);
}