Improved checks in font_render#7218
Conversation
Co-authored-by: Ondrej Baranovič <ondreko.tiba@gmail.com>
|
I'm unconcerned about the Windows failures, as I believe they will be fixed once the cache is cleared by #7216 |
|
There's a new UI for clearing CI cache files. I cleared the cache by going to https://github.com/python-pillow/Pillow/actions/caches (also https://github.com/python-pillow/Pillow/actions > Management > Caches) and deleting |
|
Thanks for the tip. Windows is now passing. Cygwin Python 3.8 is failing however, as it is also doing on main - https://github.com/python-pillow/Pillow/actions/runs/5296887052/jobs/9595867281 |
Only call text_layout once in getmask2 #7206 introduced new code to
font_render, triggering https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59831, because I didn't check thatImage.core.filldidn't return NULL. I've added a fix for that, and tested it at https://github.com/radarhere/oss-fuzz/actions/runs/5296042009 and https://github.com/radarhere/oss-fuzz/actions/runs/5296052733.I've also improved the memory handling by destroying the image when an error occurs.
Investigating https://github.com/python-pillow/Pillow/actions/runs/5262013783, I find that this failure is because of a problem checking for decompression bombs. 529621 * 541261 should be greater than
Image.MAX_IMAGE_PIXELS * 2, but instead it becomes a negative number. Casting tolong longfirst fixes that.