Fix handling of 0-length streams (Issue #111)

This commit is contained in:
Michael R Sweet
2025-03-27 12:44:42 -04:00
parent 71d33c03ff
commit ebd5aab39b
3 changed files with 4 additions and 2 deletions

View File

@@ -439,7 +439,7 @@ _pdfioStreamOpen(pdfio_obj_t *obj, // I - Object
st->pdf = obj->pdf;
st->obj = obj;
if ((st->remaining = pdfioObjGetLength(obj)) == 0)
if ((st->remaining = pdfioObjGetLength(obj)) == 0 && !_pdfioDictGetValue(pdfioObjGetDict(obj), "Length"))
{
_pdfioFileError(obj->pdf, "No stream data.");
goto error;