mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Return a PyError instead of a fake fterror.
* Update Tests to IOError rather than OSError
This commit is contained in:
parent
f2b36a1833
commit
1c57ab8429
|
@ -57,6 +57,8 @@ def test_fuzz_fonts(path):
|
|||
with open(path, "rb") as f:
|
||||
try:
|
||||
fuzzers.fuzz_font(f.read())
|
||||
except (Image.DecompressionBombError, Image.DecompressionBombWarning):
|
||||
except (Image.DecompressionBombError,
|
||||
Image.DecompressionBombWarning,
|
||||
IOError):
|
||||
pass
|
||||
assert True
|
||||
|
|
|
@ -17,6 +17,6 @@ class TestFontCrash:
|
|||
|
||||
@skip_unless_feature("freetype2")
|
||||
def test_segfault(self):
|
||||
with pytest.raises(OSError):
|
||||
with pytest.raises(IOError):
|
||||
font = ImageFont.truetype("Tests/fonts/fuzz_font-5203009437302784")
|
||||
self._fuzz_font(font)
|
||||
|
|
|
@ -923,7 +923,7 @@ font_render(FontObject *self, PyObject *args) {
|
|||
|
||||
// Null buffer, is dereferenced in FT_Bitmap_Convert
|
||||
if (!bitmap.buffer && bitmap.rows) {
|
||||
return geterror(0x9D); // Bitmap missing
|
||||
PyErr_SetString(PyExc_IOError, "Bitmap missing for glyph");
|
||||
goto glyph_error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user