shithub: opus

Download patch

ref: 44e27dd8c2e5bf0c85346f7189765e2338d8c0a9
parent: 69bfc67109abcf6ed4550b965ec65454e5b312f5
author: Jean-Marc Valin <[email protected]>
date: Mon Aug 29 19:35:17 EDT 2011

Adds missing RESTORE_STACK to Opus encoder

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -280,7 +280,10 @@
     st->rangeFinal = 0;
     if (400*frame_size != st->Fs && 200*frame_size != st->Fs && 100*frame_size != st->Fs &&
          50*frame_size != st->Fs &&  25*frame_size != st->Fs &&  50*frame_size != 3*st->Fs)
-        return OPUS_BAD_ARG;
+    {
+       RESTORE_STACK;
+       return OPUS_BAD_ARG;
+    }
     silk_enc = (char*)st+st->silk_enc_offset;
     celt_enc = (CELTEncoder*)((char*)st+st->celt_enc_offset);
 
@@ -555,6 +558,7 @@
         if (nBytes==0)
         {
            data[-1] = gen_toc(st->mode, st->Fs/frame_size, st->bandwidth, silk_internal_bandwidth, st->stream_channels);
+           RESTORE_STACK;
            return 1;
         }
         /* Extract SILK internal bandwidth for signaling in first byte */
@@ -761,6 +765,7 @@
     else
         st->prev_mode = st->mode;
     st->first = 0;
+    RESTORE_STACK;
     return ret+1+redundancy_bytes;
 }