Fix _pdfioFileRead/Seek to fix test suite-reported error loading an object.

This commit is contained in:
Michael R Sweet
2021-06-10 10:58:07 -04:00
parent d5ceed0694
commit 466cb473d1
4 changed files with 29 additions and 4 deletions

View File

@ -360,6 +360,8 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
return (false);
}
PDFIO_DEBUG("_pdfioObjLoad: Header is '%s'.\n", line);
if (strtoimax(line, &ptr, 10) != (intmax_t)obj->number)
{
_pdfioFileError(obj->pdf, "Bad header for object %lu.", (unsigned long)obj->number);
@ -403,8 +405,13 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
{
// Yes, save its location...
obj->stream_offset = _pdfioFileTell(obj->pdf);
PDFIO_DEBUG("_pdfioObjLoad: stream_offset=%lu.\n", (unsigned long)obj->stream_offset);
}
PDFIO_DEBUG("_pdfioObjLoad: ");
PDFIO_DEBUG_VALUE(&obj->value);
PDFIO_DEBUG("\n");
return (true);
}