[FFmpeg-cvslog] truemotion2: Use av_freep properly in an error path

Martin Storsjö git at videolan.org
Thu Jan 16 22:08:49 CET 2014


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Mon Sep 16 21:03:34 2013 +0300| [2ef84218b2921372aed5fcd06eb7edca3e39d01b] | committer: Luca Barbato

truemotion2: Use av_freep properly in an error path

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit c39f7eba01cd656e8f0eed592f93d11814736650)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit eac1c3f384eab770d42468f4f244156c1735701d)

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

 libavcodec/truemotion2.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 09d9e27..fd5d28c 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -907,14 +907,14 @@ static av_cold int decode_init(AVCodecContext *avctx){
     if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
         !l->V1_base || !l->U2_base || !l->V2_base ||
         !l->last    || !l->clast) {
-        av_freep(l->Y1_base);
-        av_freep(l->Y2_base);
-        av_freep(l->U1_base);
-        av_freep(l->U2_base);
-        av_freep(l->V1_base);
-        av_freep(l->V2_base);
-        av_freep(l->last);
-        av_freep(l->clast);
+        av_freep(&l->Y1_base);
+        av_freep(&l->Y2_base);
+        av_freep(&l->U1_base);
+        av_freep(&l->U2_base);
+        av_freep(&l->V1_base);
+        av_freep(&l->V2_base);
+        av_freep(&l->last);
+        av_freep(&l->clast);
         return AVERROR(ENOMEM);
     }
     l->Y1 = l->Y1_base + l->y_stride  * 4 + 4;



More information about the ffmpeg-cvslog mailing list