mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
[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
This commit is contained in:
parent
7c2e84ad2f
commit
d8db60b34a
1 changed files with 5 additions and 2 deletions
|
|
@ -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 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue