mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-12-24 05:56:25 +01:00
Add input checking to pdfioFileCreateFontObjFromBase.
This commit is contained in:
@@ -2,6 +2,12 @@ Changes in PDFio
|
|||||||
================
|
================
|
||||||
|
|
||||||
|
|
||||||
|
v1.6.1 - YYYY-MM-DD
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Added missing input checking to `pdfioFileCreateFontObjFromBase` function.
|
||||||
|
|
||||||
|
|
||||||
v1.6.0 - 2025-10-06
|
v1.6.0 - 2025-10-06
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1712,12 +1712,23 @@ pdfioFileCreateFontObjFromBase(
|
|||||||
pdfio_obj_t *obj; // Font object
|
pdfio_obj_t *obj; // Font object
|
||||||
|
|
||||||
|
|
||||||
if (pdf && pdf->profile >= _PDFIO_PROFILE_PDFA_1A && pdf->profile <= _PDFIO_PROFILE_PDFA_4)
|
// Range check input...
|
||||||
|
if (!pdf)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
if (!name)
|
||||||
|
{
|
||||||
|
_pdfioFileError(pdf, "No base font name specified.");
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pdf->profile >= _PDFIO_PROFILE_PDFA_1A && pdf->profile <= _PDFIO_PROFILE_PDFA_4)
|
||||||
{
|
{
|
||||||
_pdfioFileError(pdf, "Base fonts are not allowed in PDF/A files; use pdfioFileCreateFontObjFromFile to embed a font.");
|
_pdfioFileError(pdf, "Base fonts are not allowed in PDF/A files; use pdfioFileCreateFontObjFromFile to embed a font.");
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a base font object...
|
||||||
if ((dict = pdfioDictCreate(pdf)) == NULL)
|
if ((dict = pdfioDictCreate(pdf)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user