mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-02-22 07:00:30 +03:00
Fix BMP RLE delta escape reading from wrong file position (#9443)
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
parent
02764a0077
commit
4777a0b318
BIN
Tests/images/pal8rletrns.png
Normal file
BIN
Tests/images/pal8rletrns.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
|
|
@ -221,6 +221,11 @@ def test_rle8_eof(file_name: str, length: int) -> None:
|
|||
im.load()
|
||||
|
||||
|
||||
def test_rle_delta() -> None:
|
||||
with Image.open("Tests/images/bmp/q/pal8rletrns.bmp") as im:
|
||||
assert_image_equal_tofile(im, "Tests/images/pal8rletrns.png")
|
||||
|
||||
|
||||
def test_unsupported_bmp_bitfields_layout() -> None:
|
||||
fp = io.BytesIO(
|
||||
o32(40) # header size
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ class BmpRleDecoder(ImageFile.PyDecoder):
|
|||
bytes_read = self.fd.read(2)
|
||||
if len(bytes_read) < 2:
|
||||
break
|
||||
right, up = self.fd.read(2)
|
||||
right, up = bytes_read
|
||||
data += b"\x00" * (right + up * self.state.xsize)
|
||||
x = len(data) % self.state.xsize
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user