shithub: opus

Download patch

ref: 9357ae976e41a1418655e285a1988df808aa47a4
parent: 2fa9e6e5386fa5ef0bbe41038ca30bc16810ebb3
author: Ralph Giles <[email protected]>
date: Wed Nov 30 06:41:47 EST 2011

Enable the silk debug macros with FIXED_DEBUG.

This isn't entirely accurate, since it's also used on integer
math. However, the idea is similar: to add bounds checking.

This code asserts rather than warning, so one must pass
--enable-assertions to configure as well to get any output,
and in that case the first instance is fatal.

Quick testing shows both test_opus_decode and test_opus_encode
trigger the assertions, but running the draft-10 test vectors
does not.

--- a/silk/MacroDebug.h
+++ b/silk/MacroDebug.h
@@ -31,7 +31,7 @@
 /* Redefine macro functions with extensive assertion in DEBUG mode.
    As functions can't be undefined, this file can't work with SigProcFIX_MacroCount.h */
 
-#if 0 && defined (_DEBUG) && !defined (silk_MACRO_COUNT)
+#if defined (FIXED_DEBUG) && !defined (silk_MACRO_COUNT)
 
 #undef silk_ADD16
 static inline opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){