mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-05 19:30:30 +08:00
Checks on stated byte lengths in xref stream objects. Closes #94.
This commit is contained in:
parent
28aea0d8d7
commit
2ecf2acce5
@ -857,6 +857,15 @@ func (this *PdfParser) parseXrefStream(xstm *PdfObjectInteger) (*PdfObjectDictio
|
|||||||
s2 := int(b[0] + b[1] + b[2])
|
s2 := int(b[0] + b[1] + b[2])
|
||||||
deltab := int(b[0] + b[1] + b[2])
|
deltab := int(b[0] + b[1] + b[2])
|
||||||
|
|
||||||
|
if s0 < 0 || s1 < 0 || s2 < 0 {
|
||||||
|
common.Log.Debug("Error s value < 0 (%d,%d,%d)", s0, s1, s2)
|
||||||
|
return nil, errors.New("Range check error")
|
||||||
|
}
|
||||||
|
if deltab == 0 {
|
||||||
|
common.Log.Debug("No xref objects in stream (deltab == 0)")
|
||||||
|
return trailerDict, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate expected entries.
|
// Calculate expected entries.
|
||||||
entries := len(ds) / deltab
|
entries := len(ds) / deltab
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user