Merge pull request #252 from adrg/inline-image-stream-end

Add whitespace tolerance when searching for inline image EI operand
This commit is contained in:
Gunnsteinn Hall 2020-02-10 20:36:01 +00:00 committed by GitHub
commit fdee057a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<ws> 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)
}