Browse Source

avcodec/msrle: Check that the input is large enough to contain a end of picture code

Fixes: Timeout
Fixes: 10625/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSRLE_fuzzer-5659651283091456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1
Michael Niedermayer 6 years ago
parent
commit
203ccb8746
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/msrle.c

+ 3
- 0
libavcodec/msrle.c View File

@@ -95,6 +95,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
s->buf = buf;
s->size = buf_size;

if (buf_size < 2) //Minimally a end of picture code should be there
return AVERROR_INVALIDDATA;

if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;



Loading…
Cancel
Save