aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-10-22 14:54:09 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-20 01:34:36 +0200
commit4b9f3c4323d29af0e55222265fc92680c6480aec (patch)
tree8ac3043d5c4a7908e7c7d1b72a2433d0dcce99c2
parent84b2ec226abd6edc1f7b85c8ef2de07ae3bb07d7 (diff)
downloadffmpeg-4b9f3c4323d29af0e55222265fc92680c6480aec.tar.gz
avformat/mpeg: Don't use unintialized value
vobsub_read_packet() didn't check whether an array of AVPackets was valid and therefore used uninitialized values. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit a39536caee6607f481e9075bfb11937f46a47489)
-rw-r--r--libavformat/mpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index d10dd45d5b..ff85ad54ee 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -915,6 +915,10 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
FFDemuxSubtitlesQueue *tmpq = &vobsub->q[i];
int64_t ts;
av_assert0(tmpq->nb_subs);
+
+ if (tmpq->current_sub_idx >= tmpq->nb_subs)
+ continue;
+
ts = tmpq->subs[tmpq->current_sub_idx].pts;
if (ts < min_ts) {
min_ts = ts;