mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/iff: Check that video_size is large enough for the read parameters
video is allocated before parameters like bpp are read.
Fixes: out of array access
Fixes: 19084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5718556033679360
Fixes: 19465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5759908398235648
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 f1b97f62f8
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
780e8ac273
commit
8e75a69850
@ -322,6 +322,8 @@ static int extract_header(AVCodecContext *const avctx,
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid number of bitplanes: %u\n", s->bpp);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->video_size && s->planesize * s->bpp * avctx->height > s->video_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
av_freep(&s->ham_buf);
|
||||
av_freep(&s->ham_palbuf);
|
||||
|
Loading…
Reference in New Issue
Block a user