Bug 776661 - Initialize all of the bytes in the incoming data structure in silk_get_TOC; r=rillian

Fixes a warning under clang in dead code. Ehsan's original patch
converted to upstream-carrying style and applied by rillian.
This commit is contained in:
Ralph Giles 2012-07-23 17:42:37 -04:00
parent 018ce5e374
commit e1858f41bb
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,26 @@
# 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;

View File

@ -357,7 +357,7 @@ opus_int silk_get_TOC(
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 );

View File

@ -61,3 +61,6 @@ echo "copied from revision ${version}"
sed -e "s/^The git tag\/revision used was .*/The git tag\/revision used was ${version}./" \
${TARGET}/README_MOZILLA > ${TARGET}/README_MOZILLA+ && \
mv ${TARGET}/README_MOZILLA+ ${TARGET}/README_MOZILLA
# apply outstanding local patches
patch -p3 < ./bug776661.patch