diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-23 09:29:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-25 00:07:07 +0100 |
commit | 1ca978d6366f3c7d7df6b3d50566e892f8da605a (patch) | |
tree | b9f8dabba7944c3d6062c7b0cdd6b9d6410b5f93 /libavcodec/nuv.c | |
parent | d83002179fb377f1f201b43c9a55cc237695a1fe (diff) | |
download | ffmpeg-1ca978d6366f3c7d7df6b3d50566e892f8da605a.tar.gz |
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/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r-- | libavcodec/nuv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index eb82d375ea..7958000ae8 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -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) { |