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>
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;