Commit Graph

3203 Commits

Author SHA1 Message Date
Hugo van Kemenade
8febdad8dd Review, typos and lint 2021-04-01 17:41:46 +03:00
Eric Soroos
496245aa43 Fix BLP DOS -- CVE-2021-28678
* BlpImagePlugin did not properly check that reads after jumping to
  file offsets returned data. This could lead to a DOS where the
  decoder could be run a large number of times on empty data
* This dates to Pillow 5.1.0
2021-04-01 17:17:35 +03:00
Eric Soroos
22e9bee4ef Fix DOS in PSDImagePlugin -- CVE-2021-28675
* PSDImagePlugin did not sanity check the number of input layers and
  vs the size of the data block, this could lead to a DOS on
  Image.open prior to Image.load.
* This issue dates to the PIL fork
2021-04-01 17:17:31 +03:00
Eric Soroos
ba65f0b08e Fix Memory DOS in ImageFont
* A corrupt or specially crafted TTF font could have font metrics that
  lead to unreasonably large sizes when rendering text in
  font. ImageFont.py did not check the image size before allocating
  memory for it.
* Found with oss-fuzz
* This dates from the PIL fork
2021-04-01 17:17:27 +03:00
Eric Soroos
bb6c11fb88 Fix FLI DOS -- CVE-2021-28676
* FliDecode did not properly check that the block advance was
  non-zero, potentally leading to an infinite loop on load.
* This dates to the PIL Fork
* Found with oss-fuzz
2021-04-01 17:17:23 +03:00
Eric Soroos
5a5e6db0ab Fix EPS DOS on _open -- CVE-2021-28677
* The readline used in EPS has to deal with any combination of \r and
  \n as line endings. It used an accidentally quadratic method of
  accumulating lines while looking for a line ending.
* A malicious EPS file could use this to perform a DOS of Pillow in
  the open phase, before an image was accepted for opening.
* This dates to the PIL Fork
2021-04-01 17:17:18 +03:00
Eric Soroos
3bf5eddb89 Fix OOB Read in Jpeg2KDecode CVE-2021-25287,CVE-2021-25288
* For J2k images with multiple bands, it's legal in to have different
  widths for each band, e.g. 1 byte for L, 4 bytes for A
* This dates to Pillow 2.4.0
2021-04-01 17:17:13 +03:00
Andrew Murray
2c8684c525 Moved getxmp() into JpegImageFile 2021-04-01 22:28:37 +11:00
Hugo van Kemenade
6812205f18
Merge pull request #5144 from UrielMaD/feature_xmp 2021-04-01 12:44:47 +03:00
Hugo van Kemenade
b90c73f08d
Merge pull request #5373 from wiredfool/valgrind_test_warnings
Fix pytest valgrind warnings
2021-04-01 12:17:50 +03:00
Hugo van Kemenade
8c852e44f0
Merge pull request #5349 from latosha-maltba/master 2021-04-01 11:55:37 +03:00
Andrew Murray
37f9fcf93b Removed unused imports 2021-04-01 12:57:34 +11:00
Eric Soroos
87934e22d0 Fix for crash-0da0 2021-03-31 23:24:30 +02:00
Eric Soroos
53c80281d7 fix for crash-8115 2021-03-31 22:23:57 +02:00
Eric Soroos
45530d5ce1 fixes crash-74d2 2021-03-31 22:23:57 +02:00
Eric Soroos
22a6893364 Fix pytest valgrind warnings 2021-03-31 21:28:15 +02:00
Hugo van Kemenade
c54a7bb031
Merge pull request #5333 from radarhere/gif_frame_transparency 2021-03-31 18:08:11 +03:00
Hugo van Kemenade
727533148e
Merge pull request #5282 from radarhere/quantize
Set all transparent colors to be equal in quantize()
2021-03-31 17:58:21 +03:00
Hugo van Kemenade
683affa29c
Merge pull request #5206 from radarhere/numpy 2021-03-31 17:46:32 +03:00
Andrew Murray
b0b4fee796
Merge pull request #5350 from elejke/master
Add preserve_tone option to autocontrast
2021-03-30 07:59:57 +11:00
Andrew Murray
7844c6e483 Test that preserve_tone changes RGB images but not L images 2021-03-29 23:26:34 +11:00
wiredfool
9a683db339
Merge pull request #5274 from radarhere/gradient
Fixed linear_gradient and radial_gradient I and F modes
2021-03-28 14:35:22 +01:00
wiredfool
d0612030a0
Merge pull request #5364 from wiredfool/4641_merge
Add support for reading TIFFs with PlanarConfiguration=2
2021-03-28 14:33:42 +01:00
wiredfool
611a6d2330
Merge pull request #5328 from wiredfool/oss-fuzz
More OSS-Fuzz support
2021-03-28 14:19:29 +01:00
Konstantin Kopachev
4c2dfadf26 Swap pixel values on Big Endian 2021-03-28 15:03:37 +02:00
Konstantin Kopachev
169bb4842f only use TIFFReadRGBA* in case of o_jpeg compression 2021-03-28 15:03:37 +02:00
nulano
671837840a the previous commit also fixes these big-endian failures 2021-03-28 15:03:37 +02:00
Konstantin Kopachev
0018685a8e Add Tests and support for Planar Tiff Images 2021-03-28 15:03:37 +02:00
German Novikov
d18e55013d
Update Tests/test_imageops.py
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2021-03-28 15:02:52 +03:00
Eric Soroos
bf8cebc96d Add libxcb to fuzzers 2021-03-28 13:49:37 +02:00
Hugo van Kemenade
e405ab300b
Merge pull request #5351 from radarhere/categories 2021-03-28 14:34:50 +03:00
Andrew Murray
71cd97a519 Added deprecation warnings 2021-03-28 15:51:28 +11:00
Ondrej Baranovič
9872d57e3b
corrected comment 2021-03-27 02:06:36 +01:00
German Novikov
977e64fb61
Update Tests/test_imageops.py
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2021-03-25 14:56:30 +03:00
nulano
49fa3656b1 do not premultiply alpha when resizing with Image.NEAREST resampling 2021-03-23 13:16:20 +01:00
elejke
694d70bdc3 fixed typos in test for autocolor tone preserving 2021-03-23 13:09:51 +03:00
Andrew Murray
4a0698838d Parametrized test 2021-03-23 20:08:18 +11:00
elejke
8913166c7e fix test function name for autocontrast 2021-03-23 11:59:37 +03:00
Latosha Maltba
52794432f0 Make code for ImageMagick/GraphicsMagick more symmetric 2021-03-22 19:50:06 +00:00
Andrew Murray
35943372f0 Removed CONVERT helper variables 2021-03-22 19:50:06 +00:00
elejke
f73d238cd2 removed redundant comments in tests for tone preserving autocolor 2021-03-22 15:30:43 +03:00
German Novikov
25403063ea
Update Tests/test_imageops.py
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2021-03-22 15:27:13 +03:00
elejke
b4e5a6d202 add more tests for autocontrast preserve tone option 2021-03-22 12:06:44 +03:00
elejke
c585e6ab6b Add preserve_tone option to autocontrast 2021-03-21 21:15:13 +03:00
Hugo van Kemenade
ddcc936643
Merge pull request #5330 from radarhere/png_plte
Allow fewer PNG palette entries than the bit depth maximum when saving
2021-03-21 17:31:35 +02:00
Latosha Maltba
ef864d72f1 TestSuite: Add support for GraphicsMagick
Add support to run the tests using GraphicsMagick's "gm convert" instead
of ImageMagick's "convert".
2021-03-21 14:36:18 +00:00
Hugo van Kemenade
688e6f163f
Merge pull request #5338 from radarhere/webp_save_duration
Use duration from info dictionary when saving WebP
2021-03-21 11:35:28 +02:00
Andrew Murray
754752e78f Allow fewer palette entries than the bit depth maximum 2021-03-21 09:22:01 +11:00
Hugo van Kemenade
7235cf3135
Merge pull request #5345 from radarhere/tofile
Increased use of assert_image_equal_tofile
2021-03-21 00:05:28 +02:00
Hugo van Kemenade
e1e9569d8a
Merge pull request #5331 from radarhere/png_bits
Added test for saving PNG with bits keyword
2021-03-20 23:25:24 +02:00