priv_data is allocated internally
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 14 Jan 2007 02:21:28 +0000 (02:21 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sun, 14 Jan 2007 02:21:28 +0000 (02:21 +0000)
Originally committed as revision 7459 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/swf.c

index 21588fc..1efcfd4 100644 (file)
@@ -739,18 +739,13 @@ static int swf_probe(AVProbeData *p)
 
 static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    SWFContext *swf = 0;
+    SWFContext *swf = s->priv_data;
     ByteIOContext *pb = &s->pb;
     int nbits, len, frame_rate, tag, v;
     offset_t firstTagOff;
     AVStream *ast = 0;
     AVStream *vst = 0;
 
-    swf = av_malloc(sizeof(SWFContext));
-    if (!swf)
-        return -1;
-    s->priv_data = swf;
-
     tag = get_be32(pb) & 0xffffff00;
 
     if (tag == MKBETAG('C', 'W', 'S', 0))