Skip to content

Commit 1b9ecef

Browse files
authored
Move check before
1 parent 60cfddf commit 1b9ecef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src_c/transform.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3266,6 +3266,11 @@ blur(pgSurfaceObject *srcobj, pgSurfaceObject *dstobj, int radius,
32663266
retsurf = pgSurface_AsSurface(dstobj);
32673267
}
32683268

3269+
if ((retsurf->w) != (src->w) || (retsurf->h) != (src->h)) {
3270+
return RAISE(PyExc_ValueError,
3271+
"Destination surface not the same size.");
3272+
}
3273+
32693274
if (retsurf->w == 0 || retsurf->h == 0) {
32703275
return retsurf;
32713276
}
@@ -3283,11 +3288,6 @@ blur(pgSurfaceObject *srcobj, pgSurfaceObject *dstobj, int radius,
32833288
"of them is a subsurface, or they are sharing the same buffer.");
32843289
}
32853290

3286-
if ((retsurf->w) != (src->w) || (retsurf->h) != (src->h)) {
3287-
return RAISE(PyExc_ValueError,
3288-
"Destination surface not the same size.");
3289-
}
3290-
32913291
if (PG_SURF_BytesPerPixel(src) != PG_SURF_BytesPerPixel(retsurf)) {
32923292
return (SDL_Surface *)(RAISE(
32933293
PyExc_ValueError,

0 commit comments

Comments
 (0)