fix eof_ mis-initialization

For very very short partitions, the initial GetByte() could
set eof_ to 1, whereas some bits were available but unread yet.
So we set eof_ to 0 last.

Change-Id: Ic6b68271bc72efa4de4e64e1f57307d1d8fb613c
This commit is contained in:
Pascal Massimino 2011-01-17 00:25:18 -08:00
parent 2bc0778f85
commit 504d33937c

View File

@ -22,12 +22,12 @@ void VP8Init(VP8BitReader* const br, const uint8_t* buf, uint32_t size) {
assert(br);
assert(buf);
br->range_ = 255 - 1;
br->eof_ = 0;
br->buf_ = buf;
br->buf_end_ = buf + size;
// Need two initial bytes.
br->value_ = (VP8GetByte(br) << 8) | VP8GetByte(br);
br->left_ = -8;
br->eof_ = 0;
}
const uint8_t kVP8Log2Range[128] = {