SDL_UnionRect: If both rects are empty, zero out the result struct.

This commit is contained in:
Ryan C. Gordon 2022-03-19 09:29:01 -04:00
parent fbbd0270eb
commit c573ebe143
No known key found for this signature in database
GPG key ID: FA148B892AB48044

View file

@ -148,6 +148,7 @@ SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
if (SDL_RectEmpty(A)) { if (SDL_RectEmpty(A)) {
if (SDL_RectEmpty(B)) { if (SDL_RectEmpty(B)) {
/* A and B empty */ /* A and B empty */
SDL_zerop(result);
return; return;
} else { } else {
/* A empty, B not empty */ /* A empty, B not empty */