Fix segfault when a monitor exists but has no modes.
Thanks to Zhenyu Wang for finding this.
This commit is contained in:
parent
a8d760f567
commit
3fcb6445dc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue