Addressing more issues from scan-build
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 30 Jun 2016 03:16:51 +0000 (23:16 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 30 Jun 2016 03:16:51 +0000 (23:16 -0400)
src/opus_demo.c

index 9e99a3b..7c93069 100644 (file)
@@ -591,10 +591,11 @@ int main(int argc, char *argv[])
 
     in = (short*)malloc(max_frame_size*channels*sizeof(short));
     out = (short*)malloc(max_frame_size*channels*sizeof(short));
+    /* We need to allocate for 16-bit PCM data, but we store it as unsigned char. */
     fbytes = (unsigned char*)malloc(max_frame_size*channels*sizeof(short));
-    data[0] = (unsigned char*)calloc(max_payload_bytes,sizeof(char));
+    data[0] = (unsigned char*)calloc(max_payload_bytes,sizeof(unsigned char));
     if ( use_inbandfec ) {
-        data[1] = (unsigned char*)calloc(max_payload_bytes,sizeof(char));
+        data[1] = (unsigned char*)calloc(max_payload_bytes,sizeof(unsigned char));
     }
     if(delayed_decision)
     {