Skip to content

Commit e31e317

Browse files
committed
PDFBOX-6064: avoid exception
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928309 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1b1b7f3 commit e31e317

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,16 @@ else if( next.equals( "false" ) )
270270
if (imageData.getImageData() == null || imageData.getImageData().length == 0)
271271
{
272272
LOG.warn("empty inline image at stream offset {}",
273-
source.getPosition());
273+
(source.isClosed() ? "EOF" : source.getPosition()));
274274
}
275275
beginImageOP.setImageData(imageData.getImageData());
276276
inlineImageDepth--;
277277
}
278278
else
279279
{
280280
LOG.warn("nextToken {} at position {}, expected {}?!",
281-
nextToken, source.getPosition(), OperatorName.BEGIN_INLINE_IMAGE_DATA);
281+
nextToken, (source.isClosed() ? "EOF" : source.getPosition()),
282+
OperatorName.BEGIN_INLINE_IMAGE_DATA);
282283
}
283284
}
284285
return beginImageOP;

0 commit comments

Comments
 (0)