diff options
author | Shitiz Garg <mail@dragooon.net> | 2011-12-15 14:32:59 +0530 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 18:19:40 +0100 |
commit | 0c62a00e683bfb58c4dd5e33823e9d0d28904afc (patch) | |
tree | eefbb9102e9138aedf351fb23e6d6bce4323a294 | |
parent | 1804becb30eca0e95d85925bf9aead586809dee6 (diff) | |
download | ffmpeg-0c62a00e683bfb58c4dd5e33823e9d0d28904afc.tar.gz |
westwood: Make sure audio header info is present when parsing audio packets
Audio header information might get scrambled and would not parse,
yet wsqva_read_packet would try to parse audio packets causing
segfaults such as floating point exception.
Fixes bugzilla #141.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 566ee0eaf1543101f7a441cc42e3ddad097363bf)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/westwood.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/westwood.c b/libavformat/westwood.c index d39c4c695e..fc428fff34 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -324,6 +324,11 @@ static int wsvqa_read_packet(AVFormatContext *s, chunk_size = AV_RB32(&preamble[4]); skip_byte = chunk_size & 0x01; + if ((chunk_type == SND2_TAG || chunk_type == SND1_TAG) && wsvqa->audio_channels == 0) { + av_log(s, AV_LOG_ERROR, "audio chunk without any audio header information found\n"); + return AVERROR_INVALIDDATA; + } + if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) { if (av_new_packet(pkt, chunk_size)) |