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
This commit is contained in:
Jonas Ådahl 2020-09-08 14:22:33 +02:00
parent d338e5eed1
commit 7d822459de

View File

@ -31,6 +31,7 @@
#include "cogl-config.h" #include "cogl-config.h"
#include <gio/gio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -768,5 +769,8 @@ cogl_renderer_create_dma_buf (CoglRenderer *renderer,
if (winsys->renderer_create_dma_buf) if (winsys->renderer_create_dma_buf)
return winsys->renderer_create_dma_buf (renderer, width, height, error); 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; return NULL;
} }