summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 22:07:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 22:08:09 +0100
commit001af703c6bff7cb8009db3ac882b8d929d67d9e (patch)
treed96aeb8c7987a9e446f8c412edec909f6a4124ed /libavcodec/alac.c
parentb1191331363c444c0eaba0055cc7379221ddf8d7 (diff)
alac: check channel count more completely, fix out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index b70534383b..49ccaac67f 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -638,7 +638,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
else
avctx->channels = alac->channels;
}
- if (avctx->channels > MAX_CHANNELS) {
+ if (avctx->channels > MAX_CHANNELS || avctx->channels <= 0 ) {
av_log(avctx, AV_LOG_ERROR, "Unsupported channel count: %d\n",
avctx->channels);
return AVERROR_PATCHWELCOME;