aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-04 02:14:49 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-13 00:35:15 +0200
commit65fc03589fb48ee1d24797ad3984199b01feec82 (patch)
tree35d860fae9b4dc4067070c874a03a88537d80664
parent55e6c6b5feb7e2a9110fab1dc06ced23360b14e2 (diff)
downloadffmpeg-65fc03589fb48ee1d24797ad3984199b01feec82.tar.gz
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/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 66acb630286cf1bf03bfbdab6c7c784ff20bde61) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/pafvideo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c
index 6980ae1b35..7c5861dfaf 100644
--- a/libavcodec/pafvideo.c
+++ b/libavcodec/pafvideo.c
@@ -78,6 +78,7 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
{
PAFVideoDecContext *c = avctx->priv_data;
int i;
+ int ret;
c->width = avctx->width;
c->height = avctx->height;
@@ -90,6 +91,9 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
}
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();
if (!c->pic)