mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
Lossless decoding: fix eos_ flag condition
eos_ needs to be set only when superfluous bits have actually
been requested.
Earlier, we were assuming pre-mature end-of-stream to be an error.
Now, more precisely, we mark error when we have encountered end-of-stream *and*
we attempt to read more bits after that.
This handles cases where image data requires no bits to be read
(cherry picked from commit a9decb5584
)
Change-Id: I628e2c39c64f10c443fb51f86b1f5919cc9fd299
This commit is contained in:
parent
e6609ac6b9
commit
2e4312b14f
@ -154,7 +154,7 @@ void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start,
|
||||
// Special version that assumes br->pos_ <= br_len_.
|
||||
static int IsEndOfStreamSpecial(const VP8LBitReader* const br) {
|
||||
assert(br->pos_ <= br->len_);
|
||||
return br->pos_ == br->len_ && br->bit_pos_ >= LBITS;
|
||||
return br->pos_ == br->len_ && br->bit_pos_ > LBITS;
|
||||
}
|
||||
|
||||
static int IsEndOfStream(const VP8LBitReader* const br) {
|
||||
|
Loading…
Reference in New Issue
Block a user