summaryrefslogtreecommitdiff
path: root/libavcodec/photocd.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-09-20 21:29:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-10-18 20:42:21 +0200
commit34df97b0886c728e1ae430a7de8b3dfd2f1a5744 (patch)
treecd477fc969149615a4291a968e5d83279e306056 /libavcodec/photocd.c
parent3162482a14a8e9b97d442994eebe7f7a0a766d79 (diff)
downloadffmpeg-34df97b0886c728e1ae430a7de8b3dfd2f1a5744.tar.gz
avcodec/photocd: Use ff_set_dimensions()
Fixes: out of memory Fixes: 25588/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PHOTOCD_fuzzer-6612945080156160 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/photocd.c')
-rw-r--r--libavcodec/photocd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c
index 8fd4536a65..aa1b1059e9 100644
--- a/libavcodec/photocd.c
+++ b/libavcodec/photocd.c
@@ -323,8 +323,9 @@ static int photocd_decode_frame(AVCodecContext *avctx, void *data,
else
s->resolution = av_clip(4 - s->lowres, 0, 4);
- avctx->width = img_info[s->resolution].width;
- avctx->height = img_info[s->resolution].height;
+ ret = ff_set_dimensions(avctx, img_info[s->resolution].width, img_info[s->resolution].height);
+ if (ret < 0)
+ return ret;
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;