Skip to content
Commit 1feb45bc authored by Faith Ekstrand's avatar Faith Ekstrand Committed by Andres Gomez
Browse files

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: default avatarEero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: default avatarEric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 8c1b9882)

Squashed with commit:

st/dri: Don't expose sRGB formats to clients

Though the SARGB8888 format is used internally through its FourCC value,
it is not a real format as defined by drm_fourcc.h; it cannot be used
with KMS or other interfaces expecting drm_fourcc.h format codes.

Ensure we don't advertise it through the dmabuf format/modifier query
interfaces, preventing us from tripping over an assert.

Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
Reported-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Fixes: 8c1b9882 ("egl/dri2: Guard against invalid fourcc formats")
Acked-by: default avatarJason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit 01c0aa9f)
parent fb3303c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment