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>main
parent
8a73372e62
commit
fe06ee2054
|
@ -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…
Reference in New Issue