aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2002-10-31 12:23:35 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2002-10-31 12:23:35 +0000
commitcb146fafa5d368e634a79aa17be47c6b5c7ce550 (patch)
treec7b45b5d289ed975fccdbc40fc4028fbca7d2689
parente40fed0b62f5b8cb1736f6783b384c576455e7f1 (diff)
downloadffmpeg-cb146fafa5d368e634a79aa17be47c6b5c7ce550.tar.gz
* always set extradata_size
Originally committed as revision 1129 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libav/wav.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libav/wav.c b/libav/wav.c
index 172a5cbf14..672bd323f9 100644
--- a/libav/wav.c
+++ b/libav/wav.c
@@ -106,7 +106,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
void get_wav_header(ByteIOContext *pb, AVCodecContext *codec,
int has_extra_data)
{
- int id, bps, size;
+ int id, bps;
id = get_le16(pb);
codec->codec_type = CODEC_TYPE_AUDIO;
@@ -119,11 +119,10 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec,
bps = get_le16(pb); /* bits per sample */
codec->codec_id = wav_codec_get_id(id, bps);
if (has_extra_data) {
- size = get_le16(pb);
- if (size > 0) {
- codec->extradata = av_mallocz(size);
- get_buffer(pb, codec->extradata, size);
- codec->extradata_size = size;
+ codec->extradata_size = get_le16(pb);
+ if (codec->extradata_size > 0) {
+ codec->extradata = av_mallocz(codec->extradata_size);
+ get_buffer(pb, codec->extradata, codec->extradata_size);
}
}
}