diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-02-17 09:36:09 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2022-02-17 11:26:06 +0000 |
commit | 6a54b8bd762e14767bd75209043a67be29548565 (patch) | |
tree | f3d2d37d131706f387048ca3aecab0c71a11c406 /pdf/pdf_font1C.c | |
parent | a8b63959a69564862a47205a1c3681bcd544f0fa (diff) | |
download | ghostpdl-6a54b8bd762e14767bd75209043a67be29548565.tar.gz |
Coverity 376142: Cast to signed to handle possible negatives
Validating the length of a charstring, cast to signed type to allow for the
(probably theoretical) possibility the result is negative.
Diffstat (limited to 'pdf/pdf_font1C.c')
-rw-r--r-- | pdf/pdf_font1C.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pdf/pdf_font1C.c b/pdf/pdf_font1C.c index e25bed2af..540ed52a2 100644 --- a/pdf/pdf_font1C.c +++ b/pdf/pdf_font1C.c @@ -441,7 +441,7 @@ pdfi_cff_cid_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *p if (gscidfont->cidata.FDBytes != 0) *pfidx = (int)charstring->data[0]; - if (pgd && charstring->length - gscidfont->cidata.FDBytes >= 0) + if (pgd && ((int64_t)charstring->length - (int64_t)gscidfont->cidata.FDBytes) >= 0) gs_glyph_data_from_bytes(pgd, charstring->data + gscidfont->cidata.FDBytes, 0, charstring->length - gscidfont->cidata.FDBytes, NULL); } } @@ -451,6 +451,7 @@ pdfi_cff_cid_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *p return code; } + static int pdfi_cff_cidfont_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info) |