From fd79e32dbd004ebe71ef6d090fe8ad7ecfdb7b12 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 6 Nov 2017 10:02:35 -0500 Subject: [PATCH] evas-wayland-shm: Do not dereference a potentially freed pointer Coverity reports that _evas_dmabuf_buffer_init function here can potentially free the surface that was passed into it. If that happens, we should not be calling the _fallback function with surface as the parameter as that will directly dereference the freed pointer. Fixes Coverity CID1381707 @fix Signed-off-by: Chris Michael --- src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c index 85ccc2a5e8..b3446b03fe 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c @@ -519,7 +519,7 @@ _evas_dmabuf_surface_reconfigure(Surface *s, int w, int h, uint32_t flags EINA_U buf = _evas_dmabuf_buffer_init(surface, w, h); if (!buf) { - _fallback(surface, w, h); + if (surface) _fallback(surface, w, h); s->surf.dmabuf = NULL; return; }