[FFmpeg-devel] [PATCH] avcodec/dca_exss: always update downmix flags

foo86 foobaz86 at gmail.com
Mon May 23 17:41:27 CEST 2016


Fixes potential parsing failure when total number of channels indicated
by EXSS asset descriptor decreases mid-stream and stale embedded downmix
flags are referenced.
---
 libavcodec/dca_exss.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c
index 87b2f42..28f138f 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)) {
-- 
2.8.1



More information about the ffmpeg-devel mailing list