shithub: opus

Download patch

ref: b7b5872c9d6be8daefc79f12c23e6c7fa319deab
parent: 96480adaff14041dcf3c90167999088fea7c4f65
author: Philip Jägenstedt <[email protected]>
date: Thu Oct 11 07:27:12 EDT 2012

Fix minor issues reported by scan-build

--- a/celt/celt.c
+++ b/celt/celt.c
@@ -1187,7 +1187,6 @@
       pre[0] = _pre;
       pre[1] = _pre + (N+COMBFILTER_MAXPERIOD);
 
-      silence = 1;
       c=0; do {
          int count = 0;
          const opus_val16 * OPUS_RESTRICT pcmp = pcm+c;
--- a/silk/dec_API.c
+++ b/silk/dec_API.c
@@ -97,6 +97,8 @@
     opus_int stereo_to_mono;
     SAVE_STACK;
 
+    silk_assert( decControl->nChannelsInternal == 1 || decControl->nChannelsInternal == 2 );
+
     /**********************************/
     /* Test if first frame in payload */
     /**********************************/
--- a/silk/enc_API.c
+++ b/silk/enc_API.c
@@ -191,9 +191,8 @@
     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 @@
     } 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;
         }
     }
 
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -987,7 +987,7 @@
       }
    }
    fprintf(stdout,"    code 3 padding (%2d cases) ............... OK.\n",cfgs);
-   cfgs_total+=cfgs;cfgs=0;
+   cfgs_total+=cfgs;
    fprintf(stdout,"    opus_packet_parse ............................ OK.\n");
    fprintf(stdout,"                      All packet parsing tests passed\n");
    fprintf(stdout,"                          (%d API invocations)\n",cfgs_total);