mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Incorrect error code checking in TiffDecode.c
* since Pillow 8.1.0 * CVE-2021-25289
This commit is contained in:
parent
e5839216a5
commit
3fee28eb94
BIN
Tests/images/crash-0e16d3bfb83be87356d026d66919deaefca44dac.tif
Normal file
BIN
Tests/images/crash-0e16d3bfb83be87356d026d66919deaefca44dac.tif
Normal file
Binary file not shown.
BIN
Tests/images/crash-1152ec2d1a1a71395b6f2ce6721c38924d025bf3.tif
Normal file
BIN
Tests/images/crash-1152ec2d1a1a71395b6f2ce6721c38924d025bf3.tif
Normal file
Binary file not shown.
|
@ -24,6 +24,8 @@ from .helper import on_ci
|
|||
"Tests/images/crash_1.tif",
|
||||
"Tests/images/crash_2.tif",
|
||||
"Tests/images/crash-2020-10-test.tif",
|
||||
"Tests/images/crash-1152ec2d1a1a71395b6f2ce6721c38924d025bf3.tif",
|
||||
"Tests/images/crash-0e16d3bfb83be87356d026d66919deaefca44dac.tif",
|
||||
],
|
||||
)
|
||||
@pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data")
|
||||
|
|
|
@ -282,8 +282,7 @@ _decodeStripYCbCr(Imaging im, ImagingCodecState state, TIFF *tiff) {
|
|||
img.row_offset = state->y;
|
||||
rows_to_read = min(rows_per_strip, img.height - state->y);
|
||||
|
||||
if (TIFFRGBAImageGet(&img, (UINT32 *)state->buffer, img.width, rows_to_read) ==
|
||||
-1) {
|
||||
if (!TIFFRGBAImageGet(&img, (UINT32 *)state->buffer, img.width, rows_to_read)) {
|
||||
TRACE(("Decode Error, y: %d\n", state->y));
|
||||
state->errcode = IMAGING_CODEC_BROKEN;
|
||||
goto decodeycbcr_err;
|
||||
|
|
Loading…
Reference in New Issue
Block a user