mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-27 05:48:20 +01:00
Allow extra whitespace/newlines after stream tokens (Issue #40)
This commit is contained in:
parent
6a4ce57d09
commit
a83f7f50ff
@ -2,6 +2,13 @@ Changes in PDFio
|
|||||||
================
|
================
|
||||||
|
|
||||||
|
|
||||||
|
v1.1.2 (TBD)
|
||||||
|
------------
|
||||||
|
|
||||||
|
- Fixed an issue with broken PDF files containing extra CR and/or LF separators
|
||||||
|
after the object stream token (Issue #40)
|
||||||
|
|
||||||
|
|
||||||
v1.1.1 (March 20, 2023)
|
v1.1.1 (March 20, 2023)
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -29,7 +29,7 @@ DSONAME =
|
|||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
LIBS = -lm -lz
|
LIBS = -lm -lz
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
VERSION = 1.1.1
|
VERSION = 1.1.2
|
||||||
prefix = /usr/local
|
prefix = /usr/local
|
||||||
|
|
||||||
|
|
||||||
|
@ -420,6 +420,9 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr += 3;
|
ptr += 3;
|
||||||
|
while (*ptr && isspace(*ptr & 255))
|
||||||
|
ptr ++;
|
||||||
|
|
||||||
_pdfioFileConsume(obj->pdf, (size_t)(ptr - line));
|
_pdfioFileConsume(obj->pdf, (size_t)(ptr - line));
|
||||||
|
|
||||||
// Then grab the object value...
|
// Then grab the object value...
|
||||||
@ -438,11 +441,14 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
|
|||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tb.bufptr && tb.bufptr < tb.bufend && (*(tb.bufptr) == 0x0d || *(tb.bufptr) == 0x0a))
|
||||||
|
tb.bufptr ++; // Skip trailing CR or LF after token
|
||||||
|
|
||||||
_pdfioTokenFlush(&tb);
|
_pdfioTokenFlush(&tb);
|
||||||
|
|
||||||
if (!strcmp(line, "stream"))
|
if (!strcmp(line, "stream"))
|
||||||
{
|
{
|
||||||
// Yes, save its location...
|
// Yes, this is an embedded stream so save its location...
|
||||||
obj->stream_offset = _pdfioFileTell(obj->pdf);
|
obj->stream_offset = _pdfioFileTell(obj->pdf);
|
||||||
PDFIO_DEBUG("_pdfioObjLoad: stream_offset=%lu.\n", (unsigned long)obj->stream_offset);
|
PDFIO_DEBUG("_pdfioObjLoad: stream_offset=%lu.\n", (unsigned long)obj->stream_offset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user