summaryrefslogtreecommitdiff
path: root/libavcodec/dcadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-02 04:00:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-02 04:01:41 +0100
commitff7e2342bbc96ebc0fc51c19ee212ad160f83216 (patch)
treef1542f903ed96a84571c96fafdac35ece53624e7 /libavcodec/dcadec.c
parent9e1914dfbafb59b424a7c06cfdd324a85c33ef44 (diff)
dcadec: fix reading from prior to an array
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dcadec.c')
-rw-r--r--libavcodec/dcadec.c5
1 files changed, 5 insertions, 0 deletions
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);