* src/sfnt/ttcpal.c (tt_face_load_cpal): Add missing safety check.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9981
This commit is contained in:
Werner Lemberg 2018-08-21 10:52:14 +02:00
parent 4873eb1d31
commit 0a33b44e6e
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2018-08-21 Werner Lemberg <wl@gnu.org>
* src/sfnt/ttcpal.c (tt_face_load_cpal): Add missing safety check.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9981
2018-08-18 Werner Lemberg <wl@gnu.org>
[psaux] Avoid slow PS font parsing in case of error.

View File

@ -121,6 +121,9 @@
if ( cpal->num_colors * COLOR_SIZE > table_size - colors_offset )
goto InvalidTable;
if ( face->palette_data.num_palette_entries > cpal->num_colors )
goto InvalidTable;
cpal->color_indices = p;
cpal->colors = (FT_Byte*)( table + colors_offset );