diff utils.c @ 5103:ccb7812599f4 libavformat

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
author benoit
date Wed, 15 Jul 2009 10:00:16 +0000
parents 8c0eb348c19b
children 798a42ae722f
line wrap: on
line diff
--- a/utils.c	Wed Jul 15 05:52:49 2009 +0000
+++ b/utils.c	Wed Jul 15 10:00:16 2009 +0000
@@ -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;
 
 }