am 225eec8d: am f9d4ba77: am 69aae36e: Merge "stagefright aacenc: Safeguard against overwriting bits"
* commit '225eec8d2a1b63dfb57bcdcf3a72ab755f0e5525':
stagefright aacenc: Safeguard against overwriting bits
diff --git a/media/libstagefright/codecs/aacenc/src/bitbuffer.c b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
index a706893..0ce93d3 100644
--- a/media/libstagefright/codecs/aacenc/src/bitbuffer.c
+++ b/media/libstagefright/codecs/aacenc/src/bitbuffer.c
@@ -152,6 +152,7 @@
wBitPos = hBitBuf->wBitPos;
wBitPos += noBitsToWrite;
+ writeValue &= ~(0xffffffff << noBitsToWrite); // Mask out everything except the lowest noBitsToWrite bits
writeValue <<= 32 - wBitPos;
writeValue |= hBitBuf->cache;