summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-10-11 10:09:45 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-10-11 10:09:45 +0000
commit8d41fe285bbf7385cde537e7c9a22109ab68204f (patch)
tree81fdf39934588cd8c353d632c0b8ec1cf6a8bb20 /libavformat
parent086b05cdad9fc229fee64cfcd0e7f8ff0a9fc478 (diff)
simplify by not writing unneeded codec name to fix segfault when stream copy
Originally committed as revision 6643 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aiff.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/libavformat/aiff.c b/libavformat/aiff.c
index e258436bc1..efb4b28ee8 100644
--- a/libavformat/aiff.c
+++ b/libavformat/aiff.c
@@ -180,7 +180,6 @@ static int aiff_write_header(AVFormatContext *s)
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 @@ static int aiff_write_header(AVFormatContext *s)
return -1;
}
- coder_len = strlen(enc->codec->name);
-
/* FORM AIFF header */
put_tag(pb, "FORM");
aiff->form = url_ftell(pb);
@@ -204,10 +201,7 @@ static int aiff_write_header(AVFormatContext *s)
/* 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 @@ static int aiff_write_header(AVFormatContext *s)
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");