shithub: opus

Download patch

ref: 164f7dfa0272d89a38dc73aaeb8a0b6d885eb972
parent: 9b1a27a3bce47ccccb24f7caf8918e898044470a
author: Jean-Marc Valin <[email protected]>
date: Wed Jun 29 19:16:51 EDT 2016

Addressing more issues from scan-build

--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -591,10 +591,11 @@
 
     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)
     {