mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 22:44:30 +02:00
fix underflow for very short bitstreams
+ hardened the asserts Change-Id: Ie798ef2f9d848c131f6f84a35ea28ef254822d1e
This commit is contained in:
@ -159,7 +159,7 @@ static int ReadSymbolUnsafe(const HuffmanTree* tree, VP8LBitReader* const br) {
|
||||
|
||||
static WEBP_INLINE int ReadSymbol(const HuffmanTree* tree,
|
||||
VP8LBitReader* const br) {
|
||||
const int read_safe = (br->pos_ > br->len_ - 8);
|
||||
const int read_safe = (br->pos_ + 8 > br->len_);
|
||||
if (!read_safe) {
|
||||
return ReadSymbolUnsafe(tree, br);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user