diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-09-06 16:26:15 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-09-06 16:26:15 -0700 |
commit | f5b4032cb3734d802f93bad017955e7b552413b6 (patch) | |
tree | f02c1ae6c07492a2d87e3cc1f6a51317a55790bc /libAACdec/src/rvlcbit.cpp | |
parent | a083f27afba1da9e8fcdbd1792df435393e37fe8 (diff) | |
parent | 42f714f2ab2bc90ee320ef5f071a078179a59405 (diff) | |
download | fdk-aac-f5b4032cb3734d802f93bad017955e7b552413b6.tar.gz fdk-aac-f5b4032cb3734d802f93bad017955e7b552413b6.tar.bz2 fdk-aac-f5b4032cb3734d802f93bad017955e7b552413b6.zip |
Merge "Prevent bit buffer counter overflow." into pi-dev
am: 42f714f2ab
Change-Id: Iafb53ad6b61de977951f4a913250bcdc21e0af8d
Diffstat (limited to 'libAACdec/src/rvlcbit.cpp')
-rw-r--r-- | libAACdec/src/rvlcbit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libAACdec/src/rvlcbit.cpp b/libAACdec/src/rvlcbit.cpp index c06cf96..b0c4596 100644 --- a/libAACdec/src/rvlcbit.cpp +++ b/libAACdec/src/rvlcbit.cpp @@ -123,10 +123,10 @@ read direction. It is called very often, therefore it makes sense to inline it -------------------------------------------------------------------------------------------- */ -UCHAR rvlcReadBitFromBitstream(HANDLE_FDK_BITSTREAM bs, INT *pPosition, - UCHAR readDirection) { +UCHAR rvlcReadBitFromBitstream(HANDLE_FDK_BITSTREAM bs, const INT bsAnchor, + INT *pPosition, UCHAR readDirection) { UINT bit; - INT readBitOffset = *pPosition - FDKgetBitCnt(bs); + INT readBitOffset = (INT)FDKgetValidBits(bs) - bsAnchor + *pPosition; if (readBitOffset) { FDKpushBiDirectional(bs, readBitOffset); |