egl/dri2: Guard against invalid fourcc formats
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 28 Aug 2018 21:43:57 +0000 (16:43 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 30 Aug 2018 16:41:50 +0000 (11:41 -0500)
commit8c1b9882b2e0cde0b1ad9c6844fd5939d3bd4b24
tree287cae3beeb32cb6535ac72f903f02d6b40a352d
parentb95896f4923af820f78be6556c4cd5f4ed087f21
egl/dri2: Guard against invalid fourcc formats

We already reject attempts to import images with invalid fourcc formats
but don't really guard the queries all that well.  This makes us error
out in any calls to eglQueryDmaBufModifiersEXT if the given format is
not a valid fourcc format.  We also add an assert to ensure that drivers
don't advertise any non-fourcc formats.

Cc: mesa-stable@lists.freedesktop.org
Tested-By: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/egl/drivers/dri2/egl_dri2.c