10l, only allocate priv_data if not already done
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Mon, 8 Jan 2007 14:22:00 +0000 (14:22 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Mon, 8 Jan 2007 14:22:00 +0000 (14:22 +0000)
Originally committed as revision 7428 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/utils.c

index a4c8b6f..ab64bfc 100644 (file)
@@ -2184,12 +2184,11 @@ int av_write_header(AVFormatContext *s)
         }
     }
 
-    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);