From 001af703c6bff7cb8009db3ac882b8d929d67d9e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 13 Nov 2012 22:07:39 +0100 Subject: [PATCH] alac: check channel count more completely, fix out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/alac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;