Don't crash if the card init failed
This commit is contained in:
parent
2eba4e5832
commit
a11245fcf0
|
@ -1172,7 +1172,6 @@ KdAddScreen(ScreenInfo * pScreenInfo,
|
||||||
void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
{
|
{
|
||||||
KdCardInfo *card;
|
KdCardInfo *card;
|
||||||
|
|
||||||
KdScreenInfo *screen;
|
KdScreenInfo *screen;
|
||||||
|
|
||||||
if (!kdCardInfo) {
|
if (!kdCardInfo) {
|
||||||
|
@ -1182,9 +1181,11 @@ void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
screen = KdScreenInfoAdd(card);
|
screen = KdScreenInfoAdd(card);
|
||||||
KdParseScreen(screen, 0);
|
KdParseScreen(screen, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all of the screens for all of the cards
|
* Initialize all of the screens for all of the cards
|
||||||
*/
|
*/
|
||||||
|
int found = 0;
|
||||||
for (card = kdCardInfo; card; card = card->next) {
|
for (card = kdCardInfo; card; card = card->next) {
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
|
@ -1194,9 +1195,12 @@ void KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
|
||||||
for (screen = card->screenList; screen;
|
for (screen = card->screenList; screen;
|
||||||
screen = screen->next)
|
screen = screen->next)
|
||||||
KdInitScreen(pScreenInfo, screen, argc, argv);
|
KdInitScreen(pScreenInfo, screen, argc, argv);
|
||||||
|
found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found) return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Merge the various pixmap formats together, this can fail
|
* Merge the various pixmap formats together, this can fail
|
||||||
* when two screens share depth but not bitsPerPixel
|
* when two screens share depth but not bitsPerPixel
|
||||||
|
|
Loading…
Reference in New Issue