mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Fix segfault when a monitor exists but has no modes.
Thanks to Zhenyu Wang for finding this.
This commit is contained in:
@@ -1678,6 +1678,9 @@ nextAspectMode(DisplayModePtr start, float aspect)
|
||||
{
|
||||
DisplayModePtr m = start;
|
||||
|
||||
if (!m)
|
||||
return NULL;
|
||||
|
||||
for (m = m->next; m; m = m->next)
|
||||
if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
|
||||
return m;
|
||||
|
||||
Reference in New Issue
Block a user