Browse Source

avcodec/dfa: Check dimension against maximum

The headers from where the dimensions are read in actual files
are limited to 16bit per component.

Fixes: Timeout
Fixes: 6305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFA_fuzzer-4824270749302784

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 9d5a4fcfbb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.11
Michael Niedermayer 7 years ago
parent
commit
e77fe2b7c4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/dfa.c

+ 1
- 1
libavcodec/dfa.c View File

@@ -41,7 +41,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx)

avctx->pix_fmt = AV_PIX_FMT_PAL8;

if (!avctx->width || !avctx->height)
if (!avctx->width || !avctx->height || FFMAX(avctx->width, avctx->height) >= (1<<16))
return AVERROR_INVALIDDATA;

av_assert0(av_image_check_size(avctx->width, avctx->height, 0, avctx) >= 0);


Loading…
Cancel
Save