media/libopus/bug776661.patch
author Vicamo Yang <vyang@mozilla.com>
Wed, 31 Oct 2012 16:35:11 +0800
changeset 111876 5bf3abe91210f94d5d92ba95e114181e366d82ea
parent 100235 8020aa862817167ffbb89847dfacd8e73b17522f
permissions -rw-r--r--
Backout 67cb43bb8865: Breaks B2G Marionette

# HG changeset patch
# Parent bfb616effc20e449c553b492876a9731352496f0
Bug 776661 - Initialize all of the bytes in the incoming data structure in silk_get_TOC; r=rillian

diff --git a/media/libopus/silk/dec_API.c b/media/libopus/silk/dec_API.c
--- a/media/libopus/silk/dec_API.c
+++ b/media/libopus/silk/dec_API.c
@@ -352,17 +352,17 @@ opus_int silk_get_TOC(
 
     if( nBytesIn < 1 ) {
         return -1;
     }
     if( nFramesPerPayload < 0 || nFramesPerPayload > 3 ) {
         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 );
 
     Silk_TOC->inbandFECFlag = flags & 1;
     for( i = nFramesPerPayload - 1; i >= 0 ; i-- ) {
         flags = silk_RSHIFT( flags, 1 );
         Silk_TOC->VADFlags[ i ] = flags & 1;