diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-04-11 21:04:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-04-17 16:53:17 +0200 |
commit | c093eb30311b7148a4da1c7555498187c8cdf0db (patch) | |
tree | 1262c062c75d8d9afc7f95accb029e152fa97b76 /libavcodec/dpx.c | |
parent | 6c65e499909016ff45c207c149f287ee5b3cf808 (diff) | |
download | ffmpeg-c093eb30311b7148a4da1c7555498187c8cdf0db.tar.gz |
avcodec/dpx: Check bits_per_color earlier
Fixes: shift exponent 251 is too large for 32-bit type 'int'
Fixes: 32147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5519111675314176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r-- | libavcodec/dpx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 5372e3d586..b02996f04c 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -242,6 +242,9 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_PATCHWELCOME; } + if (bits_per_color > 32) + return AVERROR_INVALIDDATA; + buf += 820; avctx->sample_aspect_ratio.num = read32(&buf, endian); avctx->sample_aspect_ratio.den = read32(&buf, endian); |