Commit 66acb630 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pafvideo: Check allocated frame size

Fixes: OOM
Fixes: 5549/clusterfuzz-testcase-minimized-5390553567985664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0fb33a82
...@@ -78,6 +78,7 @@ static av_cold int paf_video_init(AVCodecContext *avctx) ...@@ -78,6 +78,7 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
{ {
PAFVideoDecContext *c = avctx->priv_data; PAFVideoDecContext *c = avctx->priv_data;
int i; int i;
int ret;
c->width = avctx->width; c->width = avctx->width;
c->height = avctx->height; c->height = avctx->height;
...@@ -90,6 +91,9 @@ static av_cold int paf_video_init(AVCodecContext *avctx) ...@@ -90,6 +91,9 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
} }
avctx->pix_fmt = AV_PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
ret = av_image_check_size2(avctx->width, FFALIGN(avctx->height, 256), avctx->max_pixels, avctx->pix_fmt, 0, avctx);
if (ret < 0)
return ret;
c->pic = av_frame_alloc(); c->pic = av_frame_alloc();
if (!c->pic) if (!c->pic)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment