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>
---
(cherry picked from db3aa4e03b)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1309>
This commit is contained in:
Yusuf Khan 2024-02-17 12:38:10 -08:00 committed by Marge Bot
parent 8b75ec34df
commit f653d9a0af

View File

@ -507,6 +507,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) {