File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -787,6 +787,8 @@ def _apply_alpha(
787
787
decode_parms = decode_parms [0 ]
788
788
else :
789
789
decode_parms = {}
790
+ if not isinstance (decode_parms , dict ):
791
+ decode_parms = {}
790
792
791
793
extension = None
792
794
if lfilters in (FT .FLATE_DECODE , FT .RUN_LENGTH_DECODE ):
Original file line number Diff line number Diff line change @@ -655,6 +655,14 @@ def test_ccitt_fax_decode__black_is_1():
655
655
actual_pixels = list (actual_image .getdata ())
656
656
assert expected_pixels == actual_pixels
657
657
658
+ # AttributeError: 'NullObject' object has no attribute 'get'
659
+ data_modified = get_data_from_url (url , name = name ).replace (
660
+ b"/DecodeParms [ << /K -1 /BlackIs1 true /Columns 16 /Rows 16 >> ]" ,
661
+ b"/DecodeParms [ null ]"
662
+ )
663
+ reader = PdfReader (BytesIO (data_modified ))
664
+ _ = reader .pages [0 ].images [0 ].image
665
+
658
666
659
667
@pytest .mark .enable_socket
660
668
def test_flate_decode__image_is_none_due_to_size_limit (caplog ):
You can’t perform that action at this time.
0 commit comments