Skip to content

Commit 69aae36

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "stagefright aacenc: Safeguard against overwriting bits"
2 parents d7fa7de + f4e98ba commit 69aae36

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

media/libstagefright/codecs/aacenc/src/bitbuffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Word16 WriteBits(HANDLE_BIT_BUF hBitBuf,
152152

153153
wBitPos = hBitBuf->wBitPos;
154154
wBitPos += noBitsToWrite;
155+
writeValue &= ~(0xffffffff << noBitsToWrite); // Mask out everything except the lowest noBitsToWrite bits
155156
writeValue <<= 32 - wBitPos;
156157
writeValue |= hBitBuf->cache;
157158

0 commit comments

Comments
 (0)