shithub: opus

Download patch

ref: 33ba6cc6b6e9b33f7070301d9634d87b1d42fbe7
parent: b0bef8564ef099eea4a6d98eb9c424e3ee0a11a9
author: Wessel Lubberhuizen <[email protected]>
date: Fri Oct 3 03:09:29 EDT 2008

fix stack handling

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -674,6 +674,7 @@
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
    VARDECL(celt_int16_t, in);
+   SAVE_STACK;
    ALLOC(in, C*N, celt_int16_t);
 
    for (j=0;j<C*N;j++)
@@ -687,6 +688,7 @@
    } else {
      ret=celt_encode(st,in,NULL,compressed,nbCompressedBytes);
    }
+   RESTORE_STACK;
    return ret;
 
 }
@@ -698,7 +700,7 @@
    VARDECL(celt_sig_t, in);
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
-
+   SAVE_STACK;
    ALLOC(in, C*N, celt_sig_t);
    for (j=0;j<C*N;j++) {
      in[j] = SCALEOUT(pcm[j]);
@@ -711,7 +713,7 @@
    } else {
       ret = celt_encode_float(st,in,NULL,compressed,nbCompressedBytes);
    }
-
+   RESTORE_STACK;
    return ret;
 }
 #endif
@@ -1048,6 +1050,7 @@
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
    VARDECL(celt_int16_t, out);
+   SAVE_STACK;
    ALLOC(out, C*N, celt_int16_t);
 
    ret=celt_decode(st, data, len, out);
@@ -1054,7 +1057,7 @@
 
    for (j=0;j<C*N;j++)
      pcm[j]=out[j]*(1/32768.);
-
+   RESTORE_STACK;
    return ret;
 }
 #endif /*DISABLE_FLOAT_API*/
@@ -1065,7 +1068,7 @@
    VARDECL(celt_sig_t, out);
    const int C = CHANNELS(st->mode);
    const int N = st->block_size;
-
+   SAVE_STACK;
    ALLOC(out, C*N, celt_sig_t);
 
    ret=celt_decode_float(st, data, len, out);
@@ -1073,6 +1076,7 @@
    for (j=0;j<C*N;j++)
      pcm[j] = FLOAT2INT16 (out[j]);
 
+   RESTORE_STACK;
    return ret;
 }
 #endif