Add type check for Size in trailer. Fixes #77

This commit is contained in:
Gunnsteinn Hall 2017-07-21 14:18:35 +00:00
parent 5f506b7427
commit 1769c68234

View File

@ -804,8 +804,8 @@ func (this *PdfParser) parseXrefStream(xstm *PdfObjectInteger) (*PdfObjectDictio
trailerDict := xs.PdfObjectDictionary
sizeObj := xs.PdfObjectDictionary.Get("Size").(*PdfObjectInteger)
if sizeObj == nil {
sizeObj, ok := xs.PdfObjectDictionary.Get("Size").(*PdfObjectInteger)
if !ok {
common.Log.Debug("ERROR: Missing size from xref stm")
return nil, errors.New("Missing Size from xref stm")
}