From e9d2f1de3c3d11bef5eff36737a3cad4d6c683b4 Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Mon, 10 Feb 2020 20:08:47 +0200 Subject: [PATCH] Add whitespace tolerance when searching for inline image EI operand --- contentstream/inline-image.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contentstream/inline-image.go b/contentstream/inline-image.go index ab37898dc..442c9806e 100644 --- a/contentstream/inline-image.go +++ b/contentstream/inline-image.go @@ -411,6 +411,12 @@ func (csp *ContentStreamParser) ParseInlineImage() (*ContentStreamInlineImage, e skipBytes = []byte{} skipBytes = append(skipBytes, c) state = 1 + } else if c == 'E' { + // Allow cases where EI is not preceded by whitespace. + // The extra parsing after EI should be sufficient + // in order to decide if the image stream ended. + skipBytes = append(skipBytes, c) + state = 2 } else { im.stream = append(im.stream, c) }