changeset 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 81c37b782fba
children 4c39baa3dfbf
files utils.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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;
 
 }