You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
alac: Check channel indexes more completely, fix out of array accesses.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -495,7 +495,9 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
channels = (element == TYPE_CPE) ? 2 : 1;
|
channels = (element == TYPE_CPE) ? 2 : 1;
|
||||||
if (ch + channels > alac->channels) {
|
if ( ch + channels > alac->channels
|
||||||
|
|| alac_channel_layout_offsets[alac->channels - 1][ch] + channels > alac->channels
|
||||||
|
) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
|
av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user