Fix the issue of undefined-shift in VP8GetBit.

BUG=chromium:603497

Review URL: https://codereview.webrtc.org/1888313002

Cr-Commit-Position: refs/heads/master@{#12450}
This commit is contained in:
jackychen
2016-04-20 13:24:15 -07:00
committed by Commit bot
parent 3bc9566f5a
commit 0a2c054f42

View File

@ -74,8 +74,9 @@ static int VP8GetBit(VP8BitReader* const br, int prob) {
uint8_t range = br->range_;
if (br->bits_ < 0) {
VP8LoadNewBytes(br);
if (br->eof_)
return 0;
}
const int pos = br->bits_;
const uint8_t split = (range * prob) >> 8;
const uint8_t value = static_cast<uint8_t>(br->value_ >> pos);