[FFmpeg-cvslog] avformat/mpeg: Don't use unintialized value

Andreas Rheinhardt git at videolan.org
Thu Apr 9 16:25:50 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Tue Oct 22 14:54:09 2019 +0200| [a39536caee6607f481e9075bfb11937f46a47489] | committer: Andreas Rheinhardt

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 at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a39536caee6607f481e9075bfb11937f46a47489
---

 libavformat/mpeg.c | 4 ++++
 1 file changed, 4 insertions(+)

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;



More information about the ffmpeg-cvslog mailing list