Commit 1ca978d6 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/nuv: Use ff_set_dimensions()

Fixes: OOM
Fixes: 18956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5766505644163072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d8300217
......@@ -131,10 +131,10 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height,
+ RTJPEG_HEADER_SIZE;
if (buf_size > INT_MAX/8)
return -1;
if ((ret = av_image_check_size(height, width, 0, avctx)) < 0)
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;
avctx->width = c->width = width;
avctx->height = c->height = height;
c->width = width;
c->height = height;
av_fast_malloc(&c->decomp_buf, &c->decomp_size,
buf_size);
if (!c->decomp_buf) {
......
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