From 6abafd00dbf05f74aac45514dc1a58c9610eb4e0 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 2 Apr 2020 00:37:52 +0000
Subject: [PATCH] The update rectangle applies to both the texture and the
 renderer, not just the renderer.  Fixes crash when there's fewer screen
 pixels than in the window.

---
 src/conio/sdl_con.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conio/sdl_con.c b/src/conio/sdl_con.c
index 88ca07e9f1..4a6d39167d 100644
--- a/src/conio/sdl_con.c
+++ b/src/conio/sdl_con.c
@@ -1402,11 +1402,11 @@ static void sdl_video_event_thread(void *data)
 
 									old_next = list->next;
 									if (list->next == NULL) {
-										sdl.UpdateTexture(texture, NULL, list->data, list->rect.width * sizeof(uint32_t));
 										src.x = 0;
 										src.y = 0;
 										src.w = list->rect.width;
 										src.h = list->rect.height;
+										sdl.UpdateTexture(texture, &src, list->data, list->rect.width * sizeof(uint32_t));
 										sdl.RenderCopy(renderer, texture, &src, NULL);
 									}
 									bitmap_drv_free_rect(list);
-- 
GitLab