From 44e27dd8c2e5bf0c85346f7189765e2338d8c0a9 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jmvalin@jmvalin.ca> Date: Mon, 29 Aug 2011 23:35:17 -0400 Subject: [PATCH] Adds missing RESTORE_STACK to Opus encoder --- src/opus_encoder.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 5fe8da7ec..d0ecea014 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -280,7 +280,10 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size, 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 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size, 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 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size, else st->prev_mode = st->mode; st->first = 0; + RESTORE_STACK; return ret+1+redundancy_bytes; } -- GitLab