[FFmpeg-devel] Patch: explicitly initialize AVFormatContext *ic = NULL

Art Clarke aclarke
Sat Jul 11 05:30:35 CEST 2009


On Fri, Jul 10, 2009 at 7:46 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> if()
>    av_free()
> =NULL
>
>
You know, I new about 10 minutes after I sent that patch that would be the
feedback :)  So I actually put this into our system.

- Art

-- 
http://www.xuggle.com/
xu?ggle (z?' gl) v. To freely encode, decode, and experience audio and
video.

Use Xuggle to get the power of FFmpeg in Java.
-------------- next part --------------
Index: libavformat/utils.c
===================================================================
--- libavformat/utils.c	(revision 19398)
+++ libavformat/utils.c	(working copy)
@@ -499,7 +499,9 @@
     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-devel mailing list