File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class LzwCodec(Codec):
5050 INITIAL_BITS_PER_CODE = 9 # Initial code bit width
5151 MAX_BITS_PER_CODE = 12 # Maximum code bit width
5252
53- def __init__ (self , max_output_length : int = 1_000_000_000 ) -> None :
53+ def __init__ (self , max_output_length : int = 75_000_000 ) -> None :
5454 self .max_output_length = max_output_length
5555
5656 def _initialize_encoding_table (self ) -> None :
Original file line number Diff line number Diff line change 7171)
7272
7373ZLIB_MAX_OUTPUT_LENGTH = 75_000_000
74- LZW_MAX_OUTPUT_LENGTH = 1_000_000_000
74+ LZW_MAX_OUTPUT_LENGTH = 75_000_000
7575
7676
7777def _decompress_with_limit (data : bytes ) -> bytes :
Original file line number Diff line number Diff line change @@ -92,6 +92,6 @@ def test_lzw_decoder__output_limit():
9292 page = reader .pages [0 ]
9393
9494 with pytest .raises (
95- expected_exception = LimitReachedError , match = r"^Limit reached while decompressing: 1000000170 > 1000000000 $"
95+ expected_exception = LimitReachedError , match = r"^Limit reached while decompressing: 75000828 > 75000000 $"
9696 ):
9797 page .images [0 ].image .load ()
You can’t perform that action at this time.
0 commit comments