mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
VPLBitReader bugfix: Catch error if bit_pos > LBITS too.
Earlier we were only testing for bit_pos == LBITS. But this is not sufficient, as bit_pos can jump from < LBITS to > LBITS. This was resulting in some bit-stream truncation errors not being caught. Note: Not a security bug though, as br->pos wasn't incremented in such cases and so we weren't reading beyond the buffer. Change-Id: Idadcdcbc6a5713f8fac3470f907fa37a63074836
This commit is contained in:
parent
1e898619cb
commit
96ad0e0aef
@ -179,7 +179,7 @@ void VP8LFillBitWindow(VP8LBitReader* const br) {
|
||||
}
|
||||
#endif
|
||||
ShiftBytes(br); // Slow path.
|
||||
if (br->pos_ == br->len_ && br->bit_pos_ == LBITS) {
|
||||
if (br->pos_ == br->len_ && br->bit_pos_ >= LBITS) {
|
||||
br->eos_ = 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user