From 03f4a03e71b444b7d0465481f9907afd744765d0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 11 Apr 2017 20:06:01 +0300 Subject: 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 --- test/interactive-wayland.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') 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; -- cgit v1.2.1