aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 46c3a5b37b..93db034fec 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -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;
}