mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-27 05:48:20 +01:00
Fix some coverity-reported issues.
This commit is contained in:
parent
b005175003
commit
63c0fc1926
@ -402,7 +402,8 @@ _pdfioDictRead(pdfio_file_t *pdf, // I - PDF file
|
|||||||
PDFIO_DEBUG("_pdfioDictRead(pdf=%p)\n", pdf);
|
PDFIO_DEBUG("_pdfioDictRead(pdf=%p)\n", pdf);
|
||||||
|
|
||||||
// Create a dictionary and start reading...
|
// Create a dictionary and start reading...
|
||||||
dict = pdfioDictCreate(pdf);
|
if ((dict = pdfioDictCreate(pdf)) == NULL)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
while (_pdfioTokenGet(tb, key, sizeof(key)))
|
while (_pdfioTokenGet(tb, key, sizeof(key)))
|
||||||
{
|
{
|
||||||
|
17
pdfio-file.c
17
pdfio-file.c
@ -388,15 +388,19 @@ pdfioFileCreatePage(pdfio_file_t *pdf, // I - PDF file
|
|||||||
pdfioDictSetName(dict, "Type", "Page");
|
pdfioDictSetName(dict, "Type", "Page");
|
||||||
|
|
||||||
// Create the page object...
|
// Create the page object...
|
||||||
page = pdfioFileCreateObj(pdf, dict);
|
if ((page = pdfioFileCreateObj(pdf, dict)) == NULL)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
// Create a contents object to hold the contents of the page...
|
// Create a contents object to hold the contents of the page...
|
||||||
contents_dict = pdfioDictCreate(pdf);
|
if ((contents_dict = pdfioDictCreate(pdf)) == NULL)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
pdfioDictSetName(contents_dict, "Filter", "FlateDecode");
|
pdfioDictSetName(contents_dict, "Filter", "FlateDecode");
|
||||||
#endif // !DEBUG
|
#endif // !DEBUG
|
||||||
|
|
||||||
contents = pdfioFileCreateObj(pdf, contents_dict);
|
if ((contents = pdfioFileCreateObj(pdf, contents_dict)) == NULL)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
// Add the contents stream to the pages object and write it...
|
// Add the contents stream to the pages object and write it...
|
||||||
pdfioDictSetObj(dict, "Contents", contents);
|
pdfioDictSetObj(dict, "Contents", contents);
|
||||||
@ -1372,7 +1376,12 @@ write_trailer(pdfio_file_t *pdf) // I - PDF file
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
pdf->trailer = pdfioDictCreate(pdf);
|
if ((pdf->trailer = pdfioDictCreate(pdf)) == NULL)
|
||||||
|
{
|
||||||
|
ret = false;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (pdf->encrypt)
|
if (pdf->encrypt)
|
||||||
pdfioDictSetObj(pdf->trailer, "Encrypt", pdf->encrypt);
|
pdfioDictSetObj(pdf->trailer, "Encrypt", pdf->encrypt);
|
||||||
if (pdf->id_array)
|
if (pdf->id_array)
|
||||||
|
Loading…
Reference in New Issue
Block a user