shithub: opus

Download patch

ref: 622046c1f1230e107664e35873d46b731f32df41
parent: bf7c1605f7ab52919708a6b5e759b08fea82a9f5
author: Cyril Lashkevich <[email protected]>
date: Mon Aug 6 12:38:18 EDT 2012

Fixed sizeof param in silk_get_TOC. Size for memset was calculated wrong.

Signed-off-by: Gregory Maxwell <[email protected]>
silk_get_TOC is unused, unreachable, and not useful without some
packet pre-processing, but until we remove it it should be correct.
This was also reported by Mozilla.

--- a/silk/dec_API.c
+++ b/silk/dec_API.c
@@ -357,7 +357,7 @@
         return -1;
     }
 
-    silk_memset( Silk_TOC, 0, sizeof( Silk_TOC ) );
+    silk_memset( Silk_TOC, 0, sizeof( *Silk_TOC ) );
 
     /* For stereo, extract the flags for the mid channel */
     flags = silk_RSHIFT( payload[ 0 ], 7 - nFramesPerPayload ) & ( silk_LSHIFT( 1, nFramesPerPayload + 1 ) - 1 );