Browse Source

avformat/mlvdec: fail reading a packet with 0 streams

Fixes: NULL pointer dereference
Fixes: 22604/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5667739074297856.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5bd5c31087)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.17
Michael Niedermayer 5 years ago
parent
commit
39806a275e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/mlvdec.c

+ 5
- 1
libavformat/mlvdec.c View File

@@ -384,10 +384,14 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
MlvContext *mlv = avctx->priv_data;
AVIOContext *pb;
AVStream *st = avctx->streams[mlv->stream_index];
AVStream *st;
int index, ret;
unsigned int size, space;

if (!avctx->nb_streams)
return AVERROR_EOF;

st = avctx->streams[mlv->stream_index];
if (mlv->pts >= st->duration)
return AVERROR_EOF;



Loading…
Cancel
Save