hw/xfree86: fix NULL pointer refrence to mode name

Potentially, the pointer to the mode name could be unset, this can
occur with the xf86-video-nv DDX, in that case there isnt much we can do
except check if the next mode is any better.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
This commit is contained in:
Yusuf Khan 2024-02-17 12:38:10 -08:00 committed by Peter Hutterer
parent a2e7904b1d
commit db3aa4e03b

View File

@ -509,6 +509,8 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
/* scan through the modes in the sort order above */
if ((p->type & type) != type)
continue;
if (p->name == NULL)
continue;
if (strcmp(p->name, modep->name) == 0) {