[FFmpeg-cvslog] r19436 - trunk/libavformat/utils.c

benoit subversion
Wed Jul 15 12:00:17 CEST 2009


Author: benoit
Date: Wed Jul 15 12:00:16 2009
New Revision: 19436

Log:
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

Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Wed Jul 15 10:57:27 2009	(r19435)
+++ trunk/libavformat/utils.c	Wed Jul 15 12:00:16 2009	(r19436)
@@ -499,7 +499,9 @@ int av_open_input_file(AVFormatContext *
     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;
 
 }



More information about the ffmpeg-cvslog mailing list