diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-09-06 23:02:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-09-06 23:02:17 +0000 |
commit | 42f714f2ab2bc90ee320ef5f071a078179a59405 (patch) | |
tree | 630a5e3b45019785d952869e743e4f681d2278f4 /libAACdec/src/rvlcbit.cpp | |
parent | 4d801e44baece3ce866fd31538f8569d148bd372 (diff) | |
parent | 15292f7e9620caf9e8df26a62efc2a2891ea822e (diff) | |
download | fdk-aac-42f714f2ab2bc90ee320ef5f071a078179a59405.tar.gz fdk-aac-42f714f2ab2bc90ee320ef5f071a078179a59405.tar.bz2 fdk-aac-42f714f2ab2bc90ee320ef5f071a078179a59405.zip |
Merge "Prevent bit buffer counter overflow." into pi-dev
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); |