aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-10-06 17:37:15 -0400
committerScott Anderson <ascent12@hotmail.com>2019-10-11 08:09:08 -0400
commit11bf87d678f146a94f15d162808058b1dc5630c5 (patch)
tree47b75a3407c4c9ca75626209233231d92d3c266a
parent3b4824a2fe933a829b9710da069f8e067cf7e1a5 (diff)
render/egl: support formats with zero modifiers
-rw-r--r--render/egl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/render/egl.c b/render/egl.c
index 4261dab8..69fde225 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -576,8 +576,7 @@ static int get_egl_dmabuf_modifiers(struct wlr_egl *egl, int format,
wlr_log(WLR_DEBUG, "DMA-BUF extension not present");
return -1;
}
-
- if(!egl->exts.image_dmabuf_import_modifiers_ext) {
+ if (!egl->exts.image_dmabuf_import_modifiers_ext) {
*modifiers = NULL;
return 0;
}
@@ -588,6 +587,10 @@ static int get_egl_dmabuf_modifiers(struct wlr_egl *egl, int format,
wlr_log(WLR_ERROR, "Failed to query dmabuf number of modifiers");
return -1;
}
+ if (num == 0) {
+ *modifiers = NULL;
+ return 0;
+ }
*modifiers = calloc(num, sizeof(uint64_t));
if (*modifiers == NULL) {