[FFmpeg-cvslog] avcodec/diracdec: Check ff_set_dimensions() for failure

Michael Niedermayer git at videolan.org
Thu Dec 17 19:11:17 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 17 17:02:14 2015 +0100| [73840bbe4eea1e99807bc6bcc4cbe5188025ff1d] | committer: Michael Niedermayer

avcodec/diracdec: Check ff_set_dimensions() for failure

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/diracdec.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index f35fe45..486c1b3 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1989,7 +1989,12 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
             return ret;
         }
 
-        ff_set_dimensions(avctx, dsh->width, dsh->height);
+        ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
+        if (ret < 0) {
+            av_freep(&dsh);
+            return ret;
+        }
+
         ff_set_sar(avctx, dsh->sample_aspect_ratio);
         avctx->pix_fmt         = dsh->pix_fmt;
         avctx->color_range     = dsh->color_range;



More information about the ffmpeg-cvslog mailing list