From 7d822459de31bdf7239fd83d67b19ae2961ef747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 8 Sep 2020 14:22:33 +0200 Subject: [PATCH] cogl/renderer: Set error in dmabuf constructor fallback When the CoglRenderer didn't set the DMA buffer constructor vfunc, we return NULL. What we didn't do was set the error, meaning the caller would crash if it tried to look up why DMA buffer construction failed. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1430 --- cogl/cogl/cogl-renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogl/cogl/cogl-renderer.c b/cogl/cogl/cogl-renderer.c index 3dc22c190..b0386fa51 100644 --- a/cogl/cogl/cogl-renderer.c +++ b/cogl/cogl/cogl-renderer.c @@ -31,6 +31,7 @@ #include "cogl-config.h" +#include #include #include @@ -768,5 +769,8 @@ cogl_renderer_create_dma_buf (CoglRenderer *renderer, if (winsys->renderer_create_dma_buf) return winsys->renderer_create_dma_buf (renderer, width, height, error); + g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + "CoglRenderer doesn't support creating DMA buffers"); + return NULL; }