[SCM] libav/experimental: Only free '*ic_ptr' when a caller has pre-allocated a context and passed it in (wherein av_open_input_file assumes memory ownership). Patch by Art Clarke a<surname> xuggle com

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:49:00 UTC 2013


The following commit has been merged in the experimental branch:
commit ebb82604b0b14c79917466107c39592a20e5b0c5
Author: Art Clarke <aclarke at vlideshow.com>
Date:   Wed Jul 15 10:00:16 2009 +0000

    Only free '*ic_ptr' when a caller has pre-allocated a context and passed it in
    (wherein av_open_input_file assumes memory ownership).
    Patch by Art Clarke a<surname> xuggle com
    
    Originally committed as revision 19436 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3fce3fa..0c1a50d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -499,7 +499,9 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
     av_freep(&pd->buf);
     if (pb)
         url_fclose(pb);
-    av_freep(ic_ptr);
+    if (ap && ap->prealloced_context)
+        av_free(*ic_ptr);
+    *ic_ptr = NULL;
     return err;
 
 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list