aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-17 15:33:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-17 20:02:05 +0100
commitbd62554ad243a94ee483c48adac29297d16f9fa2 (patch)
treecbecafa324fc6fea1fb35346741980459efc68b3
parentcd51f41791395d76a015851295a88d06069117c0 (diff)
downloadffmpeg-bd62554ad243a94ee483c48adac29297d16f9fa2.tar.gz
avcodec/dcadec: Check that the added xch channel isnt already there
Fixes null pointer dereference Fixes: signal_sigsegv_369609d_623_cov_2008234281_ES_6.1_16bit.dts Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 7d593495e42e92693cc8f3ce9b42cf3edcea377a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/dcadec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 82d96d281c..7d798b00fb 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2359,6 +2359,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
#else
if (s->xch_present && !s->xch_disable) {
#endif
+ if (avctx->channel_layout & AV_CH_BACK_CENTER) {
+ avpriv_request_sample(avctx, "XCh with Back center channel");
+ return AVERROR_INVALIDDATA;
+ }
avctx->channel_layout |= AV_CH_BACK_CENTER;
if (s->lfe) {
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;