projects
/
libav.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dca: Validate the channel map
[libav.git]
/
libavcodec
/
dcadec.c
diff --git
a/libavcodec/dcadec.c
b/libavcodec/dcadec.c
index
cd44323
..
af26dce
100644
(file)
--- a/
libavcodec/dcadec.c
+++ b/
libavcodec/dcadec.c
@@
-1297,6
+1297,9
@@
static int set_channel_layout(AVCodecContext *avctx, int channels, int num_core_
s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
}
s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
}
+ if (channels < ff_dca_channels[s->amode])
+ return AVERROR_INVALIDDATA;
+
if (channels > !!s->lfe &&
s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
return AVERROR_INVALIDDATA;
if (channels > !!s->lfe &&
s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
return AVERROR_INVALIDDATA;