eg: explicitly size dri2_to_egl_attribute_map[]
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 1 May 2017 18:40:31 +0000 (19:40 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 4 May 2017 17:05:47 +0000 (18:05 +0100)
This way we'll get an implicit zero initialization of the remaining
members, as required by dri2_add_config().

Fixes: e5efaeb85c3 ("egl: polish dri2_to_egl_attribute_map[]")
Cc: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.c

index 91456b025d5c7d8d1fca30eac945ebf3eaae2bf5..0be7132ac585078779f5d34a68d544f3c283e102 100644 (file)
@@ -102,7 +102,7 @@ const __DRIuseInvalidateExtension use_invalidate = {
    .base = { __DRI_USE_INVALIDATE, 1 }
 };
 
-static const EGLint dri2_to_egl_attribute_map[] = {
+static const EGLint dri2_to_egl_attribute_map[__DRI_ATTRIB_MAX] = {
    [__DRI_ATTRIB_BUFFER_SIZE ]          = EGL_BUFFER_SIZE,
    [__DRI_ATTRIB_LEVEL]                 = EGL_LEVEL,
    [__DRI_ATTRIB_RED_SIZE]              = EGL_RED_SIZE,