[bugfix] splash goes into infinite loop when vp is too small

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sat, 16 May 2026 17:36:28 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit d8db60b34ac5cc0b0662813f8e4413b1e8d00881
Author: William Wilgus <[email protected]>
Date:   Sat May 16 17:33:20 2026 -0400

    [bugfix] splash goes into infinite loop when vp is too small
    
    chris_s reported that a vp width of 1 wpuld cause the trxt reflow to go into an endless loop
    
    check for this and skip displaying the splash
    add a warning to the sim for catching unintentional cases of this
    
    Change-Id: I9e1c561f745b5bcf113d0a6cdff57a00cd190fd4

diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 35c122869a..62182b3402 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -104,10 +104,13 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
     int res = vsnprintf(splash_buf, sizeof(splash_buf), fmt, ap);
     va_end(ap);
 
-    if (res <= 0)
+    if (res <= 0 || width < space_w || height < chr_h)
     {
 #ifdef SIMULATOR
-        printf("%s ERROR %d\n", __func__, res);
+        if (res <= 0)
+            printf("ERROR: %s %d\n", __func__, res);
+        else
+            printf("WARNING: %s vp too small\n", __func__);
 #endif
         return false; /* nothing to display */
     }
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs