Skip to content

Commit cc6883d

Browse files
Gunnsteinn HallGunnsteinn Hall
authored andcommitted
Fix problem with MultiEncoder DecodeParms. Fixes #97.
1 parent 9e04cbd commit cc6883d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pdf/core/encoding.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,10 +1667,11 @@ func newMultiEncoderFromStream(streamObj *PdfObjectStream) (*MultiEncoder, error
16671667
arr, isArray := obj.(*PdfObjectArray)
16681668
if isArray {
16691669
for _, dictObj := range *arr {
1670+
dictObj = TraceToDirectObject(dictObj)
16701671
if dict, is := dictObj.(*PdfObjectDictionary); is {
16711672
decodeParamsArray = append(decodeParamsArray, dict)
16721673
} else {
1673-
decodeParamsArray = append(decodeParamsArray, nil)
1674+
decodeParamsArray = append(decodeParamsArray, MakeDict())
16741675
}
16751676
}
16761677
}
@@ -1713,7 +1714,7 @@ func newMultiEncoderFromStream(streamObj *PdfObjectStream) (*MultiEncoder, error
17131714
dParams = dict
17141715
}
17151716

1716-
common.Log.Trace("Next name: %s", *name)
1717+
common.Log.Trace("Next name: %s, dp: %v, dParams: %v", *name, dp, dParams)
17171718
if *name == StreamEncodingFilterNameFlate {
17181719
// XXX: need to separate out the DecodeParms..
17191720
encoder, err := newFlateEncoderFromStream(streamObj, dParams)

0 commit comments

Comments
 (0)