audio_channel would be sometimes zero and cause floating point exception due to
division by zero.
Fixed bugzilla #141
---
libavformat/westwood.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libavformat/westwood.c b/libavformat/westwood.c
index 67a00c9..531391f 100644
--- a/libavformat/westwood.c
+++ b/libavformat/westwood.c
@@ -321,6 +321,11 @@ static int wsvqa_read_packet(AVFormatContext *s,
unsigned int chunk_size;
int skip_byte;
+ if (wsvqa->audio_channels == 0) {
+ av_log(s, AV_LOG_ERROR, "invalid number of audio channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+
while (avio_read(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
chunk_type = AV_RB32(&preamble[0]);
chunk_size = AV_RB32(&preamble[4]);
--
1.7.5.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel