shithub: opus

Download patch

ref: 640f7fd8e3f25256ef502511316a33bb40ad5f94
parent: 2014ca380e0190ec4f68b7a9d720227fff0225c4
author: Jean-Marc Valin <[email protected]>
date: Sun Jun 21 05:47:51 EDT 2009

Gives an error when trying to create a stereo mode with DISABLE_STEREO defined.

--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -418,6 +418,17 @@
 #endif
    
 #endif /* !STATIC_MODES */
+
+#ifdef DISABLE_STEREO
+   if (channels > 1)
+   {
+      celt_warning("Stereo support was disable from this build");
+      if (error)
+         *error = CELT_BAD_ARG;
+      return NULL;
+   }
+#endif
+
    mdct_init(&mode->mdct, 2*mode->mdctSize);
    mode->fft = pitch_state_alloc(MAX_PERIOD);