forked from minhngoc25a/freetype2
[gzip] Handle inflate returning Z_NEED_DICT
When `inflate` returns `Z_NEED_DICT` this is currently not reported as an error and callers may assume that the decompression succeeded when it did not. In particular, a compressed table in a woff file may not actually be decompressed and written as expected, leaving the backing memory for the expanded table uninitialized. * src/gzlip/ftgzip.c (FT_Gzip_Uncompress): treat `Z_NEED_DICT` as indicating invalid data since there is no means to provide a dictionary. Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335712
This commit is contained in:
parent
58395dd200
commit
8bb7722a53
|
@ -790,6 +790,9 @@
|
|||
if ( err == Z_DATA_ERROR )
|
||||
return FT_THROW( Invalid_Table );
|
||||
|
||||
if ( err == Z_NEED_DICT )
|
||||
return FT_THROW( Invalid_Table );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue