[FFmpeg-cvslog] avcodec/mimic: Use ff_set_dimensions() to set the dimensions

Michael Niedermayer git at videolan.org
Fri Jun 2 03:04:57 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu May 18 17:46:56 2017 +0200| [e46bc3052dc1286c5430a35f2259a09812d8ad7d] | committer: Michael Niedermayer

avcodec/mimic: Use ff_set_dimensions() to set the dimensions

Fixes: OOM
Fixes: 1671/clusterfuzz-testcase-minimized-4759078033162240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e434840fd4b3c854beec845f950b80bc1bf93b60)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/mimic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 61ce1ce584..70565af199 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -390,9 +390,11 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
             return AVERROR_INVALIDDATA;
         }
 
+        res = ff_set_dimensions(avctx, width, height);
+        if (res < 0)
+            return res;
+
         ctx->avctx     = avctx;
-        avctx->width   = width;
-        avctx->height  = height;
         avctx->pix_fmt = AV_PIX_FMT_YUV420P;
         for (i = 0; i < 3; i++) {
             ctx->num_vblocks[i] = AV_CEIL_RSHIFT(height,   3 + !!i);



More information about the ffmpeg-cvslog mailing list