gl-renderer: Don't leak EGLImages on import fail

This only happens for the legacy renderer, but still, might as well
clean up after ourselves when we can't import a secondary plane.

Signed-off-by: Daniel Stone <daniels@collabora.com>
dev
Daniel Stone 3 years ago
parent 4519461439
commit bb624754f1
  1. 4
      libweston/renderer-gl/gl-renderer.c

@ -2315,7 +2315,9 @@ gl_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer)
attribs); attribs);
if (!gb->images[i]) { if (!gb->images[i]) {
weston_log("failed to create img for plane %d\n", i); weston_log("failed to create img for plane %d\n", i);
continue; while (--i >= 0)
egl_image_unref(gb->images[i]);
return;
} }
glActiveTexture(GL_TEXTURE0 + i); glActiveTexture(GL_TEXTURE0 + i);

Loading…
Cancel
Save