SDL_ttf: Prevent negative draw line and out of bounds.

From 82e58bf5cf4e090c4e9b45d147aec6a1ce2eab13 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Tue, 9 Jan 2024 15:17:37 +0100
Subject: [PATCH] Prevent negative draw line and out of bounds.

can be reproduced with testapp.c, int seed = 1704796537, at iteration ~270
---
 src/SDL_ttf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 1397ed1..ae99f0f 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -3895,6 +3895,7 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text
         } else {
             xoffset = 0;
         }
+        xoffset = SDL_max(0, xoffset);
 
         /* Render one text line to textbuf at (xstart, ystart) */
         if (Render_Line(render_mode, font->render_subpixel, font, textbuf, xstart + xoffset, ystart, fg) < 0) {