Fix PDF object check.

Signed-off-by: yzrh <yzrh@noema.org>
This commit is contained in:
yzrh 2022-12-30 20:16:53 +00:00
parent 226f16ddf4
commit 1d899d934d

View file

@ -328,7 +328,9 @@ cnki_pdf(cnki_t **param)
printf("Root object is %d.\n", root);
}
if (pdf_get_obj(&pdf, root, NULL) != 0) {
pdf_object_t *tmp;
if (pdf_get_obj(&pdf, root, &tmp) != 0) {
if ((*param)->stat > 0)
printf("Root object is missing\n");
@ -423,8 +425,6 @@ cnki_pdf(cnki_t **param)
if ((*param)->stat > 1)
printf("Deleting xref object\n");
pdf_object_t *tmp;
pdf_get_obj(&pdf, xref, &tmp);
pdf_obj_del(&pdf, xref);
@ -1106,7 +1106,7 @@ cnki_pdf_hn(cnki_t **param)
return 1;
}
pdf_object_t *tmp = NULL;
pdf_object_t *tmp;
/* Add /Parent to page object */
for (int i = 0; i < (*param)->file_stat->page; i++) {