Commit 03f4a03e71b444b7d0465481f9907afd744765d0

Ran Benita 2017-04-11T20:06:01

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>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;