diff options
author | foo86 <foobaz86@gmail.com> | 2016-05-23 18:41:27 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-23 22:54:44 +0200 |
commit | 9bd1d79584c6f99ec12c85c458eaa9ca826b2d12 (patch) | |
tree | 15b16fc9df3d50c7c4236a7db8f4bf45c9641ef0 | |
parent | 5b8faaad6c71bbb90951ca1642391e11cf6f5f91 (diff) | |
download | ffmpeg-9bd1d79584c6f99ec12c85c458eaa9ca826b2d12.tar.gz |
avcodec/dca_exss: always update downmix flags
Fixes potential parsing failure when total number of channels indicated
by EXSS asset descriptor decreases mid-stream and stale embedded downmix
flags are referenced.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/dca_exss.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c index 87b2f42afb..28f138f404 100644 --- a/libavcodec/dca_exss.c +++ b/libavcodec/dca_exss.c @@ -112,12 +112,10 @@ static int parse_descriptor(DCAExssParser *s, DCAExssAsset *asset) int nspeakers[8]; // Embedded stereo flag - if (asset->nchannels_total > 2) - asset->embedded_stereo = get_bits1(&s->gb); + asset->embedded_stereo = asset->nchannels_total > 2 && get_bits1(&s->gb); // Embedded 6 channels flag - if (asset->nchannels_total > 6) - asset->embedded_6ch = get_bits1(&s->gb); + asset->embedded_6ch = asset->nchannels_total > 6 && get_bits1(&s->gb); // Speaker mask enabled flag if (asset->spkr_mask_enabled = get_bits1(&s->gb)) { |