[FFmpeg-cvslog] rv34: Fix a memory leak on errors

Martin Storsjö git at videolan.org
Thu Sep 19 13:50:21 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Sep 16 16:05:18 2013 +0300| [fdbd924b84e85ac5c80f01ee059ed5c81d3cc205] | committer: Martin Storsjö

rv34: Fix a memory leak on errors

Signed-off-by: Martin Storsjö <martin at martin.st>

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

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

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index af37855..7eb97e7 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1495,8 +1495,10 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
         ff_rv40dsp_init(&r->rdsp);
 #endif
 
-    if ((ret = rv34_decoder_alloc(r)) < 0)
+    if ((ret = rv34_decoder_alloc(r)) < 0) {
+        ff_MPV_common_end(&r->s);
         return ret;
+    }
 
     if(!intra_vlcs[0].cbppattern[0].bits)
         rv34_init_tables();
@@ -1517,8 +1519,10 @@ int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
         r->tmp_b_block_base = NULL;
         if ((err = ff_MPV_common_init(&r->s)) < 0)
             return err;
-        if ((err = rv34_decoder_alloc(r)) < 0)
+        if ((err = rv34_decoder_alloc(r)) < 0) {
+            ff_MPV_common_end(&r->s);
             return err;
+        }
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list