diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 23:37:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-14 23:37:44 +0100 |
commit | 02d6d053396626ff5b3390e48a9933e0d4164b28 (patch) | |
tree | 227b9d962f03cc98a77072f7a61ba259b12b43d5 /libavcodec/dcadec.c | |
parent | 51fcf276f8ce66be530549da6b8d96a4bd3087aa (diff) | |
download | ffmpeg-streaming-02d6d053396626ff5b3390e48a9933e0d4164b28.zip ffmpeg-streaming-02d6d053396626ff5b3390e48a9933e0d4164b28.tar.gz |
dcadec: check xch_base_channel against channel_order_tab.
Fix null pointer dereference
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 59c1e6e..e7ae6e2 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -2247,6 +2247,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, } else { s->channel_order_tab = dca_channel_reorder_nolfe_xch[s->amode]; } + if (s->channel_order_tab[s->xch_base_channel] < 0) + return AVERROR_INVALIDDATA; } else { channels = num_core_channels + !!s->lfe; s->xch_present = 0; /* disable further xch processing */ |