[FFmpeg-devel] [PATCH] indeo3: remove unnecessary iv_free_func() function

Stefano Sabatini stefano.sabatini-lala at poste.it
Tue May 17 22:30:05 CEST 2011


Call the freeing code directly in indeo3_decode_close(). Simplify.
---
 libavcodec/indeo3.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index c7ca61d..993850c 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -149,13 +149,6 @@ static av_cold int iv_alloc_frames(Indeo3DecodeContext *s)
     return 0;
 }
 
-static av_cold void iv_free_func(Indeo3DecodeContext *s)
-{
-    av_freep(&s->buf);
-    av_freep(&s->ModPred);
-    av_freep(&s->corrector_type);
-}
-
 struct ustr {
     int xpos;
     int ypos;
@@ -979,8 +972,6 @@ static av_cold int indeo3_decode_init(AVCodecContext *avctx)
 
     if (!(ret = build_modpred(s)))
         ret = iv_alloc_frames(s);
-    if (ret)
-        iv_free_func(s);
 
     return ret;
 }
@@ -1141,7 +1132,9 @@ static av_cold int indeo3_decode_end(AVCodecContext *avctx)
 {
     Indeo3DecodeContext *s = avctx->priv_data;
 
-    iv_free_func(s);
+    av_freep(&s->buf);
+    av_freep(&s->ModPred);
+    av_freep(&s->corrector_type);
 
     return 0;
 }
-- 
1.7.2.3



More information about the ffmpeg-devel mailing list