SDL: Fixed bug #4625: with integer scale, viewport (as reported by SDL_RenderGetViewport) becomes -2147483648x-2147483648

From 49369142bddc27203241fce3d23d5b6f4b316fb8 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Sun, 21 Nov 2021 17:40:48 +0100
Subject: [PATCH] Fixed bug #4625: with integer scale, viewport (as reported by
 SDL_RenderGetViewport) becomes -2147483648x-2147483648 0 isn't valid scale.
 Min integer scale is 1.0f

---
 src/render/SDL_render.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 5c037c443cd..2b814e78ac8 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -2270,6 +2270,11 @@ UpdateLogicalSize(SDL_Renderer *renderer)
         } else {
             scale = (float)(h / renderer->logical_h);
         }
+
+        if (scale < 1.0f) {
+            scale = 1.0f;
+        }
+
         viewport.w = (int)SDL_floor(renderer->logical_w * scale);
         viewport.x = (w - viewport.w) / 2;
         viewport.h = (int)SDL_floor(renderer->logical_h * scale);