From 95977f41b701beb2c2dc246fda41ca6fbf594394 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 25 Oct 2025 13:47:11 -0700 Subject: [PATCH] Perform full rectangle intersection for empty rects If we don't do that, we leave the x and y values uninitialized. Fixes https://github.com/libsdl-org/sdl12-compat/issues/365 (cherry picked from commit ffd0ca4391dc012d11d7cbe22279ecc25400621b) --- src/video/SDL_rect_impl.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/video/SDL_rect_impl.h b/src/video/SDL_rect_impl.h index d35f073315..619698ef8e 100644 --- a/src/video/SDL_rect_impl.h +++ b/src/video/SDL_rect_impl.h @@ -48,8 +48,6 @@ bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) SDL_RECT_CAN_OVERFLOW(B)) { SDL_SetError("Potential rect math overflow"); return false; - } else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { - return false; // Special cases for empty rects } // Horizontal intersection @@ -100,10 +98,6 @@ bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) } else if (!result) { SDL_InvalidParamError("result"); return false; - } else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { // Special cases for empty rects - result->w = 0; - result->h = 0; - return false; } // Horizontal intersection