mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
trap alpha-decoding error
Improves robustness to bad bitstream. Change-Id: I87ca03ccd12d4d690904b35f8dfc2a20a28fb47b
This commit is contained in:
parent
b361eca1c5
commit
08e865822a
@ -350,7 +350,7 @@ static int DecompressZlibTCoder(const uint8_t* data, size_t data_size,
|
|||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
VP8BitReader br;
|
VP8BitReader br;
|
||||||
VP8InitBitReader(&br, data, data + data_size);
|
VP8InitBitReader(&br, data, data + data_size);
|
||||||
while (pos < output_size) {
|
while (pos < output_size && !br.eof_) {
|
||||||
const int dist = TCoderDecode(coderd, &br);
|
const int dist = TCoderDecode(coderd, &br);
|
||||||
if (dist == 0) {
|
if (dist == 0) {
|
||||||
const int literal = TCoderDecode(coder, &br);
|
const int literal = TCoderDecode(coder, &br);
|
||||||
@ -366,8 +366,8 @@ static int DecompressZlibTCoder(const uint8_t* data, size_t data_size,
|
|||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ok = !br.eof_;
|
||||||
}
|
}
|
||||||
ok = 1;
|
|
||||||
|
|
||||||
End:
|
End:
|
||||||
if (coder) TCoderDelete(coder);
|
if (coder) TCoderDelete(coder);
|
||||||
|
Loading…
Reference in New Issue
Block a user