mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/hdrdec: Check input size before buffer allocation
Fixes: Timeout Fixes: 471948155/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_DEC_fuzzer-5679690418552832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -126,6 +126,9 @@ static int hdr_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||
;
|
||||
}
|
||||
|
||||
if (bytestream2_get_bytes_left(&gb) < height * 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user