diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 22:07:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 22:08:09 +0100 |
commit | 001af703c6bff7cb8009db3ac882b8d929d67d9e (patch) | |
tree | d96aeb8c7987a9e446f8c412edec909f6a4124ed /libavcodec/alac.c | |
parent | b1191331363c444c0eaba0055cc7379221ddf8d7 (diff) | |
download | ffmpeg-001af703c6bff7cb8009db3ac882b8d929d67d9e.tar.gz |
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.c | 2 |
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; |