gl-renderer: Fix crash in dmabuf format query for fallback formats

Since formats is an out parameter, we need to copy to the alloc'ed
memory and not over the pointer address.

Signed-off-by: Philipp Kerling <pkerling@casix.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Philipp Kerling 7 years ago committed by Daniel Stone
parent 44fc1be913
commit 3995ffaf3d
  1. 2
      libweston/gl-renderer.c

@ -2122,7 +2122,7 @@ gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
} }
if (fallback) { if (fallback) {
memcpy(formats, fallback_formats, num * sizeof(int)); memcpy(*formats, fallback_formats, num * sizeof(int));
*num_formats = num; *num_formats = num;
return; return;
} }

Loading…
Cancel
Save