Skip to content

Commit d5d77e8

Browse files
MyreMylaroddbookworm
authored andcommitted
Add pixel size test
1 parent f1b006d commit d5d77e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src_c/transform.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,6 +4240,12 @@ pixelate(pgSurfaceObject *srcobj, pgSurfaceObject *dstobj, int pixel_size)
42404240
newsurf = pgSurface_AsSurface(dstobj);
42414241
}
42424242

4243+
if (pixel_size < 1) {
4244+
return (SDL_Surface *)(RAISE(
4245+
PyExc_ValueError,
4246+
"pixel_size must be greater than 0."));
4247+
}
4248+
42434249
if (newsurf->w != src->w || newsurf->h != src->h) {
42444250
return (SDL_Surface *)(RAISE(
42454251
PyExc_ValueError,

0 commit comments

Comments
 (0)