Fixing the global stack -- and an overflow in collapse_mask
This commit is contained in:
parent
2799c29792
commit
7e983194a3
2 changed files with 8 additions and 2 deletions
|
@ -1435,7 +1435,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Residual quantisation */
|
/* Residual quantisation */
|
||||||
ALLOC(collapse_masks, st->mode->nbEBands, unsigned char);
|
ALLOC(collapse_masks, C*st->mode->nbEBands, unsigned char);
|
||||||
quant_all_bands(1, st->mode, st->start, st->end, X, C==2 ? X+N : NULL, collapse_masks,
|
quant_all_bands(1, st->mode, st->start, st->end, X, C==2 ? X+N : NULL, collapse_masks,
|
||||||
bandE, pulses, shortBlocks, st->spread_decision, dual_stereo, intensity, tf_res, resynth,
|
bandE, pulses, shortBlocks, st->spread_decision, dual_stereo, intensity, tf_res, resynth,
|
||||||
nbCompressedBytes*(8<<BITRES)-anti_collapse_rsv, balance, enc, LM, codedBands, &st->rng);
|
nbCompressedBytes*(8<<BITRES)-anti_collapse_rsv, balance, enc, LM, codedBands, &st->rng);
|
||||||
|
@ -1585,6 +1585,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const float * pcm, int
|
||||||
{
|
{
|
||||||
int j, ret, C, N;
|
int j, ret, C, N;
|
||||||
VARDECL(celt_int16, in);
|
VARDECL(celt_int16, in);
|
||||||
|
ALLOC_STACK;
|
||||||
SAVE_STACK;
|
SAVE_STACK;
|
||||||
|
|
||||||
if (pcm==NULL)
|
if (pcm==NULL)
|
||||||
|
@ -1612,6 +1613,7 @@ int celt_encode_with_ec(CELTEncoder * restrict st, const celt_int16 * pcm, int f
|
||||||
{
|
{
|
||||||
int j, ret, C, N;
|
int j, ret, C, N;
|
||||||
VARDECL(celt_sig, in);
|
VARDECL(celt_sig, in);
|
||||||
|
ALLOC_STACK;
|
||||||
SAVE_STACK;
|
SAVE_STACK;
|
||||||
|
|
||||||
if (pcm==NULL)
|
if (pcm==NULL)
|
||||||
|
@ -2341,7 +2343,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
|
||||||
unquant_fine_energy(st->mode, st->start, st->end, oldBandE, fine_quant, dec, C);
|
unquant_fine_energy(st->mode, st->start, st->end, oldBandE, fine_quant, dec, C);
|
||||||
|
|
||||||
/* Decode fixed codebook */
|
/* Decode fixed codebook */
|
||||||
ALLOC(collapse_masks, st->mode->nbEBands, unsigned char);
|
ALLOC(collapse_masks, C*st->mode->nbEBands, unsigned char);
|
||||||
quant_all_bands(0, st->mode, st->start, st->end, X, C==2 ? X+N : NULL, collapse_masks,
|
quant_all_bands(0, st->mode, st->start, st->end, X, C==2 ? X+N : NULL, collapse_masks,
|
||||||
NULL, pulses, shortBlocks, spread_decision, dual_stereo, intensity, tf_res, 1,
|
NULL, pulses, shortBlocks, spread_decision, dual_stereo, intensity, tf_res, 1,
|
||||||
len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng);
|
len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng);
|
||||||
|
@ -2468,6 +2470,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
|
||||||
{
|
{
|
||||||
int j, ret, C, N;
|
int j, ret, C, N;
|
||||||
VARDECL(celt_int16, out);
|
VARDECL(celt_int16, out);
|
||||||
|
ALLOC_STACK;
|
||||||
SAVE_STACK;
|
SAVE_STACK;
|
||||||
|
|
||||||
if (pcm==NULL)
|
if (pcm==NULL)
|
||||||
|
@ -2491,6 +2494,7 @@ int celt_decode_with_ec(CELTDecoder * restrict st, const unsigned char *data, in
|
||||||
{
|
{
|
||||||
int j, ret, C, N;
|
int j, ret, C, N;
|
||||||
VARDECL(celt_sig, out);
|
VARDECL(celt_sig, out);
|
||||||
|
ALLOC_STACK;
|
||||||
SAVE_STACK;
|
SAVE_STACK;
|
||||||
|
|
||||||
if (pcm==NULL)
|
if (pcm==NULL)
|
||||||
|
|
|
@ -286,11 +286,13 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
|
||||||
scanf("%d ", band_allocation+i);
|
scanf("%d ", band_allocation+i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CUSTOM_MODES
|
||||||
ALLOC_STACK;
|
ALLOC_STACK;
|
||||||
#if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA)
|
#if !defined(VAR_ARRAYS) && !defined(USE_ALLOCA)
|
||||||
if (global_stack==NULL)
|
if (global_stack==NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CUSTOM_MODES_ONLY
|
#ifndef CUSTOM_MODES_ONLY
|
||||||
for (i=0;i<TOTAL_MODES;i++)
|
for (i=0;i<TOTAL_MODES;i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue