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 a39536caee)
This commit is contained in:
Andreas Rheinhardt 2019-10-22 14:54:09 +02:00
parent 84b2ec226a
commit 4b9f3c4323
1 changed files with 4 additions and 0 deletions

View File

@ -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;