Fix minor issues reported by scan-build

This commit is contained in:
Philip Jägenstedt 2012-10-11 11:27:12 +02:00 committed by Gregory Maxwell
parent 96480adaff
commit b7b5872c9d
4 changed files with 6 additions and 8 deletions

View file

@ -191,9 +191,8 @@ opus_int silk_Encode( /* O Returns error co
if( prefillFlag ) {
/* Only accept input length of 10 ms */
if( nBlocksOf10ms != 1 ) {
ret = SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
silk_assert( 0 );
return ret;
return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
}
/* Reset Encoder */
for( n = 0; n < encControl->nChannelsInternal; n++ ) {
@ -212,15 +211,13 @@ opus_int silk_Encode( /* O Returns error co
} else {
/* Only accept input lengths that are a multiple of 10 ms */
if( nBlocksOf10ms * encControl->API_sampleRate != 100 * nSamplesIn || nSamplesIn < 0 ) {
ret = SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
silk_assert( 0 );
return ret;
return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
}
/* Make sure no more than one packet can be produced */
if( 1000 * (opus_int32)nSamplesIn > encControl->payloadSize_ms * encControl->API_sampleRate ) {
ret = SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
silk_assert( 0 );
return ret;
return SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES;
}
}