Skip to content

Commit 8017d38

Browse files
Sackzementslouken
authored andcommitted
SDL_BlitSurfaceScaled(): Do not blit if surfaces have no pixel data
1 parent 18fbe6a commit 8017d38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/video/SDL_surface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,9 +1101,9 @@ bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surfac
11011101
int dst_w, dst_h;
11021102

11031103
// Make sure the surfaces aren't locked
1104-
if (!SDL_SurfaceValid(src)) {
1104+
if (!SDL_SurfaceValid(src) || !src->pixels) {
11051105
return SDL_InvalidParamError("src");
1106-
} else if (!SDL_SurfaceValid(dst)) {
1106+
} else if (!SDL_SurfaceValid(dst) || !dst->pixels) {
11071107
return SDL_InvalidParamError("dst");
11081108
} else if ((src->flags & SDL_SURFACE_LOCKED) || (dst->flags & SDL_SURFACE_LOCKED)) {
11091109
return SDL_SetError("Surfaces must not be locked during blit");

0 commit comments

Comments
 (0)