Converting some silk_assert()s into hardening celt_assert()s

Only converted the ones that are really sure (not signal-dependent)
and that shouldn't add much run-time complexity
This commit is contained in:
Jean-Marc Valin 2018-03-24 02:16:15 -04:00
parent 69bcb28d3d
commit 7e3352ef51
No known key found for this signature in database
GPG key ID: 5E5DD9A36F9189C8
29 changed files with 96 additions and 96 deletions

View file

@ -55,7 +55,7 @@ opus_int silk_decode_frame(
psDecCtrl->LTP_scale_Q14 = 0;
/* Safety checks */
silk_assert( L > 0 && L <= MAX_FRAME_LENGTH );
celt_assert( L > 0 && L <= MAX_FRAME_LENGTH );
if( lostFlag == FLAG_DECODE_NORMAL ||
( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) )
@ -91,7 +91,7 @@ opus_int silk_decode_frame(
psDec->lossCnt = 0;
psDec->prevSignalType = psDec->indices.signalType;
silk_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 );
celt_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 );
/* A frame has been decoded without errors */
psDec->first_frame_after_reset = 0;
@ -104,7 +104,7 @@ opus_int silk_decode_frame(
/*************************/
/* Update output buffer. */
/*************************/
silk_assert( psDec->ltp_mem_length >= psDec->frame_length );
celt_assert( psDec->ltp_mem_length >= psDec->frame_length );
mv_len = psDec->ltp_mem_length - psDec->frame_length;
silk_memmove( psDec->outBuf, &psDec->outBuf[ psDec->frame_length ], mv_len * sizeof(opus_int16) );
silk_memcpy( &psDec->outBuf[ mv_len ], pOut, psDec->frame_length * sizeof( opus_int16 ) );