[FFmpeg-cvslog] avcodec/nuv: Use ff_set_dimensions()

Michael Niedermayer git at videolan.org
Sun Dec 1 19:57:00 EET 2019


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Nov 23 09:29:58 2019 +0100| [db659cdf47892e13b75facfd5407397ddd26c3b7] | committer: 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/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1ca978d6366f3c7d7df6b3d50566e892f8da605a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db659cdf47892e13b75facfd5407397ddd26c3b7
---

 libavcodec/nuv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 6192a70c74..39f4e79ba0 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) {



More information about the ffmpeg-cvslog mailing list