mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 00:10:11 +01:00
tests: Only copy con->modes[0] if it exists
con->modes can be NULL. Fixes crash in that case. Closes: https://gitlab.freedesktop.org/mesa/drm/issues/34 Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
8a73372e62
commit
fe06ee2054
1 changed files with 3 additions and 1 deletions
|
|
@ -42,7 +42,9 @@ static void kms_screen_probe(struct kms_screen *screen)
|
|||
else
|
||||
screen->connected = false;
|
||||
|
||||
memcpy(&screen->mode, &con->modes[0], sizeof(drmModeModeInfo));
|
||||
if (con->modes)
|
||||
memcpy(&screen->mode, &con->modes[0], sizeof(drmModeModeInfo));
|
||||
|
||||
screen->width = screen->mode.hdisplay;
|
||||
screen->height = screen->mode.vdisplay;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue