Fix rare crash seen when dereferencing backgroundIcon[NONE].
Because backgroundIcon[] is not initialized by the ScreenRecoveryUI constructor, it should be initialized explicitly to NULL in Init(). If it is not initialized, ScreenRecoveryUI::SetBackground() can fail for the NONE icon because the NULL test can fail and junk will be dereferenced. Change-Id: I4e3738d2e241ed90df43c984fb41e0072933f50a
This commit is contained in:
committed by
Doug Zongker
parent
9690e2b370
commit
9b8ae8038b
@@ -376,6 +376,7 @@ void ScreenRecoveryUI::Init()
|
||||
text_cols = gr_fb_width() / char_width;
|
||||
if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1;
|
||||
|
||||
backgroundIcon[NONE] = NULL;
|
||||
LoadBitmap("icon_installing", &backgroundIcon[INSTALLING_UPDATE]);
|
||||
backgroundIcon[ERASING] = backgroundIcon[INSTALLING_UPDATE];
|
||||
LoadBitmap("icon_error", &backgroundIcon[ERROR]);
|
||||
|
||||
Reference in New Issue
Block a user