Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/parser/epub/deobfuscator.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ func (d DeobfuscatingResource) Stream(w io.Writer, start int64, end int64) (int6
shasum := sha1.Sum([]byte(d.identifier))
obfuscationKey = shasum[:]
}

// If getHashKeyAdobe() is blank, meaning the hex decoding of the UUID failed
if len(obfuscationKey) == 0 {
return 0, fetcher.Other(errors.New("error deriving font deobfuscation key"))
}

deobfuscateFont(obfuscatedPortion, start, obfuscationKey, v)

defer pr.Close()
Expand Down