mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
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:
parent
2bc0778f85
commit
504d33937c
@ -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] = {
|
||||
|
Loading…
Reference in New Issue
Block a user