Skip to content

Commit

Permalink
Merge "stagefright aacenc: Safeguard against overwriting bits"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste Queru authored and android code review committed Feb 29, 2012
2 parents d7fa7de + f4e98ba commit 69aae36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions media/libstagefright/codecs/aacenc/src/bitbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Word16 WriteBits(HANDLE_BIT_BUF hBitBuf,

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

Expand Down

0 comments on commit 69aae36

Please sign in to comment.