Description
The attached file throws an exception:
java.io.IOException: Image stream is empty
at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:117)
at org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage.getImage(PDInlineImage.java:234)
at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:1082)
at org.apache.pdfbox.util.operator.graphics.BeginInlineImage.process(BeginInlineImage.java:40)
The reason is this:
BI /H 1 /W 256 /CS /RGB /BPC 8 /F [] ...
The empty filter array is incorrectly processed in PDInlineImage, it results in an empty output stream. Checking for an empty array like checking for null solves the problem.