Browse Source

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>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
b53f89710b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/alac.c

+ 3
- 1
libavcodec/alac.c View File

@@ -495,7 +495,9 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
}

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");
return AVERROR_INVALIDDATA;
}


Loading…
Cancel
Save