[FFmpeg-cvslog] avcodec/libutvideoenc: Fix memleak

Michael Niedermayer git at videolan.org
Mon May 25 00:43:27 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 23:53:24 2015 +0200| [1cacecce79537a2c114c70c325b719774a8387eb] | committer: Michael Niedermayer

avcodec/libutvideoenc: Fix memleak

Fixes: CID1257657

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/libutvideoenc.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index 3b88fff..cf669d2 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -96,8 +96,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
      * since we cannot decode planes separately with it.
      */
     ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
-    if (ret < 0)
+    if (ret < 0) {
+        av_free(info);
         return ret;
+    }
     utv->buf_size = ret;
 
     utv->buffer = (uint8_t *)av_malloc(utv->buf_size);



More information about the ffmpeg-cvslog mailing list