Fixes: OOM
Fixes: 2143/clusterfuzz-testcase-minimized-5482288060039168
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
buf += 2;
ret = av_image_check_size2(region->width, region->height, avctx->max_pixels, AV_PIX_FMT_PAL8, 0, avctx);
+ if (ret >= 0 && region->width * region->height * 2 > 320 * 1024 * 8) {
+ ret = AVERROR_INVALIDDATA;
+ av_log(avctx, AV_LOG_ERROR, "Pixel buffer memory constraint violated\n");
+ }
if (ret < 0) {
region->width= region->height= 0;
return ret;