diff options
author | Philip Jägenstedt <philip@foolip.org> | 2012-10-11 13:27:12 +0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2012-10-11 17:21:44 +0400 |
commit | b7b5872c9d6be8daefc79f12c23e6c7fa319deab (patch) | |
tree | 84df6abbfec6eb8c9d4f80f2d231e9954a310025 /silk | |
parent | 96480adaff14041dcf3c90167999088fea7c4f65 (diff) |
Fix minor issues reported by scan-build
Diffstat (limited to 'silk')
-rw-r--r-- | silk/dec_API.c | 2 | ||||
-rw-r--r-- | silk/enc_API.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/silk/dec_API.c b/silk/dec_API.c index 68403b7c..58b6b2b1 100644 --- a/silk/dec_API.c +++ b/silk/dec_API.c @@ -97,6 +97,8 @@ opus_int silk_Decode( /* O Returns error co opus_int stereo_to_mono; SAVE_STACK; + silk_assert( decControl->nChannelsInternal == 1 || decControl->nChannelsInternal == 2 ); + /**********************************/ /* Test if first frame in payload */ /**********************************/ diff --git a/silk/enc_API.c b/silk/enc_API.c index ec7915ce..325e16ad 100644 --- a/silk/enc_API.c +++ b/silk/enc_API.c @@ -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; } } |