mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-07 00:50:13 +01:00
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
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue