Commit c573ebe1439e51e6b50f2ec37c381d13d643fe22

Ryan C. Gordon 2022-03-19T09:29:01

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

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c
index 0c92951..dd2c7bc 100644
--- a/src/video/SDL_rect.c
+++ b/src/video/SDL_rect.c
@@ -148,6 +148,7 @@ SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
     if (SDL_RectEmpty(A)) {
       if (SDL_RectEmpty(B)) {
        /* A and B empty */
+       SDL_zerop(result);
        return;
       } else {
        /* A empty, B not empty */