mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 14:38:13 +02:00
Fixed crash in _cairo_lzw_compress for 1 byte input
This commit is contained in:
parent
9b2e6f1994
commit
bd15b62906
1 changed files with 4 additions and 1 deletions
|
|
@ -369,7 +369,10 @@ _cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out)
|
|||
* lookup. */
|
||||
_lzw_buf_store_bits (&buf, prev, code_bits);
|
||||
|
||||
LZW_SYMBOL_SET_CODE (*slot, code_next++, prev, next);
|
||||
if (likely (slot != NULL))
|
||||
LZW_SYMBOL_SET_CODE (*slot, code_next, prev, next);
|
||||
|
||||
code_next++;
|
||||
|
||||
if (code_next > LZW_BITS_BOUNDARY(code_bits))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue