summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
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-04-09 15:16:20 +0200
commita39536caee6607f481e9075bfb11937f46a47489 (patch)
treecabe779d932e43502cff5a13e7a0780148ccb5a9 /libavformat/mpeg.c
parent46d2b2071b3f42c6f885efad547080106985dd5e (diff)
downloadffmpeg-a39536caee6607f481e9075bfb11937f46a47489.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>
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index eba5852266..33c0398060 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -927,6 +927,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;