Browse Source

avcodec/fic: Check input size against minimal frame size

Fixes: Timeout (22sec ->54ms)
Fixes: 14439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5660988231122944

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.2
Michael Niedermayer 6 years ago
parent
commit
c7f95d2bd9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/fic.c

+ 1
- 1
libavcodec/fic.c View File

@@ -356,7 +356,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices; sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE; msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;


if (msize <= 0) {
if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n"); av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }


Loading…
Cancel
Save