[Ffmpeg-cvslog] r6643 - in trunk: libavformat/aiff.c tests/libav.regression.ref

bcoudurier subversion
Wed Oct 11 12:09:46 CEST 2006


Author: bcoudurier
Date: Wed Oct 11 12:09:45 2006
New Revision: 6643

Modified:
   trunk/libavformat/aiff.c
   trunk/tests/libav.regression.ref

Log:
simplify by not writing unneeded codec name to fix segfault when stream copy

Modified: trunk/libavformat/aiff.c
==============================================================================
--- trunk/libavformat/aiff.c	(original)
+++ trunk/libavformat/aiff.c	Wed Oct 11 12:09:45 2006
@@ -180,7 +180,6 @@
     ByteIOContext *pb = &s->pb;
     AVCodecContext *enc = s->streams[0]->codec;
     AVExtFloat sample_rate;
-    int coder_len;
 
     /* First verify if format is ok */
     enc->codec_tag = codec_get_tag(codec_aiff_tags, enc->codec_id);
@@ -189,8 +188,6 @@
         return -1;
     }
 
-    coder_len = strlen(enc->codec->name);
-
     /* FORM AIFF header */
     put_tag(pb, "FORM");
     aiff->form = url_ftell(pb);
@@ -204,10 +201,7 @@
 
     /* Common chunk */
     put_tag(pb, "COMM");
-    if (coder_len & 1)                  /* Common chunk is of var size */
-        put_be32(pb, 23+coder_len);
-    else
-        put_be32(pb, 24+coder_len);
+    put_be32(pb, 24); /* size */
     put_be16(pb, enc->channels);        /* Number of channels */
 
     aiff->frames = url_ftell(pb);
@@ -221,14 +215,7 @@
     put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
 
     put_le32(pb, enc->codec_tag);
-    if (coder_len & 1) {
-        put_byte(pb, coder_len);
-        put_buffer(pb, (const uint8_t*)enc->codec->name, coder_len);
-    } else {
-        put_byte(pb, coder_len+1);
-        put_buffer(pb, (const uint8_t*)enc->codec->name, coder_len);
-        put_byte(pb, 0);
-    }
+    put_be16(pb, 0);
 
     /* Sound data chunk */
     put_tag(pb, "SSND");

Modified: trunk/tests/libav.regression.ref
==============================================================================
--- trunk/tests/libav.regression.ref	(original)
+++ trunk/tests/libav.regression.ref	Wed Oct 11 12:09:45 2006
@@ -65,8 +65,8 @@
 272b91d8fc31ed43b08246d182719751 *./data/b-libav.mmf
   22609 ./data/b-libav.mmf
 ./data/b-libav.mmf CRC=0x03633476
-a324baee6d76c53ab7c74616cfc31616 *./data/b-libav.aif
-  89168 ./data/b-libav.aif
+c8cf5bac13fb7862bcbce76977328f92 *./data/b-libav.aif
+89160 ./data/b-libav.aif
 ./data/b-libav.aif CRC=0x2a09519c
 8d117c49d6b210abe783d1b0b897cec7 *./data/b-libav.voc
   32768 ./data/b-libav.voc




More information about the ffmpeg-cvslog mailing list