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 Change-Id: I628e2c39c64f10c443fb51f86b1f5919cc9fd299
This commit is contained in:
parent
3fea6a28da
commit
a9decb5584
@ -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