From ff7e2342bbc96ebc0fc51c19ee212ad160f83216 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 2 Dec 2012 04:00:50 +0100 Subject: [PATCH] dcadec: fix reading from prior to an array Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/dcadec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 77fe92a693..acbabd64cc 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -2164,6 +2164,11 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, continue; } + if (s->xch_base_channel < 2) { + av_log_ask_for_sample(avctx, "XCh with fewer than 2 base channels is not supported\n"); + continue; + } + /* much like core primary audio coding header */ dca_parse_audio_coding_header(s, s->xch_base_channel, 0);