gecko-dev/media/libopus/bug776661.patch

27 строки
974 B
Diff

# 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;