Fixed
Created: Oct 23, 2017
Updated: Dec 3, 2018
Resolved Date: Oct 26, 2017
Found In Version: 9.0.0.10
Fix Version: 9.0.0.12
Severity: Standard
Applicable for: Wind River Linux 9
Component/s: Userspace
I am putting the customers description as it is very complete:
Using the "psplash-write MSG <message_text>" command, you can display messages when the splash screen is running. As part of this, psplash needs to calculate the height and width of the box to render on the screen to hold the text (which will appear on top of the background image), which it does in the psplash_fb_text_size() function in psplash-fb.c.
If the message contains multiple lines (i.e. it contains one or more newline characters), then it looks like the intention is for psplash to use the length of the longest single line as the width of this text box. However, there's a bug in this calculation that leads to some multi-line messages being rendered off the left edge of the screen, instead of properly centered.
To fix this, each time a newline is encountered, if the width of the current line (w) is greater than the maximum line width (mw), update the maximum width. Also, reset the current line width to zero so we can correctly calculate the width of the next line.