mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-27 05:48:20 +01:00
Merge 0-character font fix from TTF.
This commit is contained in:
parent
138f3955d1
commit
7e01451b18
6
ttf.c
6
ttf.c
@ -1323,7 +1323,7 @@ read_cmap(ttf_t *font) // I - Font
|
|||||||
TTF_DEBUG("read_cmap: glyphIdArray[%d]=%d\n", i, glyphIdArray[i]);
|
TTF_DEBUG("read_cmap: glyphIdArray[%d]=%d\n", i, glyphIdArray[i]);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
if (font->num_cmap > TTF_FONT_MAX_CHAR)
|
if (font->num_cmap == 0 || font->num_cmap > TTF_FONT_MAX_CHAR)
|
||||||
{
|
{
|
||||||
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
||||||
return (false);
|
return (false);
|
||||||
@ -1433,7 +1433,7 @@ read_cmap(ttf_t *font) // I - Font
|
|||||||
// uncompressed cmap table...
|
// uncompressed cmap table...
|
||||||
TTF_DEBUG("read_cmap: num_cmap=%u\n", (unsigned)font->num_cmap);
|
TTF_DEBUG("read_cmap: num_cmap=%u\n", (unsigned)font->num_cmap);
|
||||||
|
|
||||||
if (font->num_cmap > TTF_FONT_MAX_CHAR)
|
if (font->num_cmap == 0 || font->num_cmap > TTF_FONT_MAX_CHAR)
|
||||||
{
|
{
|
||||||
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
||||||
return (false);
|
return (false);
|
||||||
@ -1522,7 +1522,7 @@ read_cmap(ttf_t *font) // I - Font
|
|||||||
// uncompressed cmap table...
|
// uncompressed cmap table...
|
||||||
TTF_DEBUG("read_cmap: num_cmap=%u\n", (unsigned)font->num_cmap);
|
TTF_DEBUG("read_cmap: num_cmap=%u\n", (unsigned)font->num_cmap);
|
||||||
|
|
||||||
if (font->num_cmap > TTF_FONT_MAX_CHAR)
|
if (font->num_cmap == 0 || font->num_cmap > TTF_FONT_MAX_CHAR)
|
||||||
{
|
{
|
||||||
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
errorf(font, "Invalid cmap table with %u characters.", (unsigned)font->num_cmap);
|
||||||
return (false);
|
return (false);
|
||||||
|
Loading…
Reference in New Issue
Block a user