ac3enc: clip large coefficient values and negative exponents rather than using
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 16 Apr 2011 03:18:33 +0000 (23:18 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sun, 1 May 2011 17:32:04 +0000 (13:32 -0400)
av_assert2().

libavcodec/ac3dsp.c

index dccad3b..e3ca37e 100644 (file)
@@ -164,8 +164,10 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
             if (e >= 24) {
                 e = 24;
                 coef[i] = 0;
+            } else if (e < 0) {
+                e = 0;
+                coef[i] = av_clip(coef[i], -16777215, 16777215);
             }
-            av_assert2(e >= 0);
         }
         exp[i] = e;
     }