Fix another coverity issue.

This commit is contained in:
Michael R Sweet 2021-06-09 09:18:52 -04:00
parent 63c0fc1926
commit a962b1d069
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244

View File

@ -285,6 +285,10 @@ pdfioFileCreateObj(
_pdfio_value_t value; // Object value
// Range check input...
if (!pdf || !dict)
return (NULL);
value.type = PDFIO_VALTYPE_DICT;
value.value.dict = dict;
@ -372,6 +376,9 @@ pdfioFileCreatePage(pdfio_file_t *pdf, // I - PDF file
else
dict = pdfioDictCreate(pdf);
if (!dict)
return (NULL);
// Make sure the page dictionary has all of the required keys...
if (!_pdfioDictGetValue(dict, "CropBox"))
pdfioDictSetRect(dict, "CropBox", &pdf->crop_box);