Skip to content

Commit

Permalink
Fix OSCE using uninitialized range coder for PLC
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Feb 1, 2024
1 parent 53c2313 commit f20575d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions silk/decode_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,11 @@ opus_int silk_decode_frame(
{
VARDECL( silk_decoder_control, psDecCtrl );
opus_int L, mv_len, ret = 0;
#ifdef ENABLE_OSCE
opus_int32 ec_start;
#endif
SAVE_STACK;

L = psDec->frame_length;
ALLOC( psDecCtrl, 1, silk_decoder_control );
psDecCtrl->LTP_scale_Q14 = 0;
#ifdef ENABLE_OSCE
ec_start = ec_tell(psRangeDec);
#endif

/* Safety checks */
celt_assert( L > 0 && L <= MAX_FRAME_LENGTH );
Expand All @@ -77,6 +71,10 @@ opus_int silk_decode_frame(
( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) )
{
VARDECL( opus_int16, pulses );
#ifdef ENABLE_OSCE
opus_int32 ec_start;
ec_start = ec_tell(psRangeDec);
#endif
ALLOC( pulses, (L + SHELL_CODEC_FRAME_LENGTH - 1) &
~(SHELL_CODEC_FRAME_LENGTH - 1), opus_int16 );
/*********************************************/
Expand Down

0 comments on commit f20575d

Please sign in to comment.