Fix crash in FBDev DGA mode when it failed to initialize (here, that was

because fb visual was Direct Color instead of True Color). We used to
initialize the_buffer* even if !open_display. Report that gracefully with
the dedicated STR_OPEN_WINDOW_ERR.
This commit is contained in:
gbeauche 2005-06-22 16:40:24 +00:00
parent c41f403f56
commit c33f09b2d8

View File

@ -1023,8 +1023,10 @@ static bool open_display(void)
#endif
// Zero screen buffers, viRowBytes is initialized at this stage
memset(the_buffer, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize);
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize);
if (display_open) {
memset(the_buffer, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize);
memset(the_buffer_copy, 0, VModes[cur_mode].viRowBytes * VModes[cur_mode].viYsize);
}
return display_open;
}
@ -1643,8 +1645,10 @@ bool VideoInit(void)
#endif
// Open window/screen
if (!open_display())
if (!open_display()) {
ErrorAlert(GetString(STR_OPEN_WINDOW_ERR));
return false;
}
#if 0
// Ignore errors from now on