Fix for crash in CCITT decoder. Resolves https://github.com/unidoc/unipdf/issues/314 (#315)

This commit is contained in:
Gunnsteinn Hall 2020-04-16 23:05:50 +00:00 committed by GitHub
parent 61ff51916a
commit 11f3a6e7a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,6 +412,11 @@ func seekChangingElem(row []byte, currElem int) int {
if currElem >= len(row) {
return currElem
}
if currElem < -1 {
// A current element of -1 means white color starting prior to first element (0).
// Should not be able to go any further left than that.
currElem = -1
}
var color byte
if currElem > -1 {