diff utils.c @ 1625:f1ccbe0ad364 libavformat

10l, only allocate priv_data if not already done
author bcoudurier
date Mon, 08 Jan 2007 14:22:00 +0000
parents 66f000bb4558
children 8a13bce78882
line wrap: on
line diff
--- a/utils.c	Mon Jan 08 12:57:08 2007 +0000
+++ b/utils.c	Mon Jan 08 14:22:00 2007 +0000
@@ -2184,12 +2184,11 @@
         }
     }
 
-    if (s->oformat->priv_data_size > 0) {
+    if (!s->priv_data && s->oformat->priv_data_size > 0) {
         s->priv_data = av_mallocz(s->oformat->priv_data_size);
         if (!s->priv_data)
             return AVERROR_NOMEM;
-    } else
-        s->priv_data = NULL;
+    }
 
     if(s->oformat->write_header){
         ret = s->oformat->write_header(s);