summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2017-04-11 20:06:01 +0300
committerRan Benita <ran234@gmail.com>2017-04-11 21:01:41 +0300
commit03f4a03e71b444b7d0465481f9907afd744765d0 (patch)
treea74f47510285fff3fa546a97968f93c4cc98be57 /test
parent0f43cfa225cefcce121c94bcde0de7a66bb63526 (diff)
downloadxorg-lib-libxkbcommon-03f4a03e71b444b7d0465481f9907afd744765d0.tar.gz
test/interactive-wayland: handle unrecognized SHM format
The enum seems large, and we don't handle all of the values in it. Previously if we got an unrecognized SHM format we would use an uninitialized `stride`. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/interactive-wayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/interactive-wayland.c b/test/interactive-wayland.c
index c86ed60..1b1b0dd 100644
--- a/test/interactive-wayland.c
+++ b/test/interactive-wayland.c
@@ -221,6 +221,9 @@ buffer_create(struct interactive_dpy *inter, uint32_t width, uint32_t height)
case WL_SHM_FORMAT_BGR565:
stride = width * 2;
break;
+ default:
+ fprintf(stderr, "Unsupported SHM format %d\n", inter->shm_format);
+ exit(1);
}
size = stride * height;