[libav-stable] alsdec: only adapt order for positive max_order

Andreas Cadhalpun git at libav.org
Tue May 5 16:32:15 CEST 2015


Module: libav
Branch: master
Commit: 60f1cc4a1ffcbf24acbb543988ceeaec76b70818

Author:    Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Wed Apr 22 16:03:41 2015 +0200

alsdec: only adapt order for positive max_order

For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)

CC: libav-stable at libav.org
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

---

 libavcodec/alsdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index a5452c3..1ade656 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -663,7 +663,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
 
 
     if (!sconf->rlslms) {
-        if (sconf->adapt_order) {
+        if (sconf->adapt_order && sconf->max_order) {
             int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
                                                 2, sconf->max_order + 1));
             *bd->opt_order       = get_bits(gb, opt_order_length);



More information about the libav-stable mailing list