aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/au.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-22 15:32:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-22 15:34:15 +0200
commit8aa57b7b5e06c1cd9dbb2e84e48caa0ef840c5dc (patch)
tree88e3fc95fe9f9822f7733d7a3e60e6911af9bcc9 /libavformat/au.c
parentfd2127ad53370c4f5d615265c4f915126e7d5f4f (diff)
downloadffmpeg-8aa57b7b5e06c1cd9dbb2e84e48caa0ef840c5dc.tar.gz
audemux: Check channels isnt 0
Fixes a division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/au.c')
-rw-r--r--libavformat/au.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/au.c b/libavformat/au.c
index 67e6cab181..bec0d7641b 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -150,6 +150,11 @@ static int au_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
+ if (channels <= 0) {
+ av_log(s, AV_LOG_ERROR, "Invalid number of channels %d\n", channels);
+ return AVERROR_INVALIDDATA;
+ }
+
if (size >= 24) {
/* skip unused data */
avio_skip(pb, size - 24);