mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
3162482a14
commit
34df97b088
@ -323,8 +323,9 @@ static int photocd_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
else
|
else
|
||||||
s->resolution = av_clip(4 - s->lowres, 0, 4);
|
s->resolution = av_clip(4 - s->lowres, 0, 4);
|
||||||
|
|
||||||
avctx->width = img_info[s->resolution].width;
|
ret = ff_set_dimensions(avctx, img_info[s->resolution].width, img_info[s->resolution].height);
|
||||||
avctx->height = img_info[s->resolution].height;
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
|
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user