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:
Michael Niedermayer
2026-02-10 17:22:11 +01:00
parent 55bb6e2646
commit 538824fd84

View File

@@ -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;