Fix object map to use unique file hash instead of pointer values (Issue #125)

This commit is contained in:
Michael R Sweet
2025-04-24 14:00:24 -04:00
parent 5b08046ece
commit 57a01a7317
5 changed files with 51 additions and 14 deletions

View File

@@ -79,6 +79,10 @@ pdfioObjCopy(pdfio_file_t *pdf, // I - PDF file
if (srcobj->value.type == PDFIO_VALTYPE_NONE)
_pdfioObjLoad(srcobj);
// See if we have already mapped this object...
if ((dstobj = _pdfioFileFindMappedObj(pdf, srcobj->pdf, srcobj->number)) != NULL)
return (dstobj); // Yes, return that one...
// Create the new object...
if ((dstobj = _pdfioFileCreateObj(pdf, srcobj->pdf, NULL)) == NULL)
return (NULL);