Bug 1688851 - Check if modifiers are valid before adding. r=stransky,jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D103662
This commit is contained in:
Robert Mader 2021-02-05 09:39:02 +00:00
parent f5f947be77
commit 59052dc303
3 changed files with 10 additions and 3 deletions

View File

@ -116,6 +116,12 @@ static void dmabuf_modifiers(void* data,
struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf,
uint32_t format, uint32_t modifier_hi,
uint32_t modifier_lo) {
// skip modifiers marked as invalid
if (modifier_hi == (DRM_FORMAT_MOD_INVALID >> 32) &&
modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff)) {
return;
}
auto* device = static_cast<nsDMABufDevice*>(data);
switch (format) {
case GBM_FORMAT_ARGB8888:

View File

@ -20,6 +20,10 @@ extern mozilla::LazyLogModule gDmabufLog;
# define LOGDMABUF(args)
#endif /* MOZ_LOGGING */
#ifndef DRM_FORMAT_MOD_INVALID
# define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
#endif
namespace mozilla {
namespace widget {

View File

@ -49,9 +49,6 @@ using namespace mozilla::widget;
using namespace mozilla::gl;
using namespace mozilla::layers;
#ifndef DRM_FORMAT_MOD_INVALID
# define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
#endif
#define BUFFER_FLAGS 0
#ifndef GBM_BO_USE_TEXTURING