summaryrefslogtreecommitdiff
path: root/celt/celt_encoder.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-15 01:52:28 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-15 01:52:28 -0500
commite83d2aa3f7e61cdea146f580c99fda7d3593a3ff (patch)
tree7858bcf9a5a207145be72ef821b630f4d73d917f /celt/celt_encoder.c
parentd7aadd808fd2d6f2d8f4a5daf8b3ec32a0968e8e (diff)
downloadopus-e83d2aa3f7e61cdea146f580c99fda7d3593a3ff.tar.gz
Adds missing RESTORE_STACKs in celt_encode_with_ec()
Diffstat (limited to 'celt/celt_encoder.c')
-rw-r--r--celt/celt_encoder.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index ba78ea97..6c5e5cdc 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1305,14 +1305,20 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
eBands = mode->eBands;
tf_estimate = 0;
if (nbCompressedBytes<2 || pcm==NULL)
- return OPUS_BAD_ARG;
+ {
+ RESTORE_STACK
+ return OPUS_BAD_ARG;
+ }
frame_size *= st->upsample;
for (LM=0;LM<=mode->maxLM;LM++)
if (mode->shortMdctSize<<LM==frame_size)
break;
if (LM>mode->maxLM)
+ {
+ RESTORE_STACK
return OPUS_BAD_ARG;
+ }
M=1<<LM;
N = M*mode->shortMdctSize;
@@ -1343,7 +1349,10 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
{
int c0 = toOpus(compressed[0]);
if (c0<0)
+ {
+ RESTORE_STACK
return OPUS_BAD_ARG;
+ }
compressed[0] = c0;
}
compressed++;