wayland-egl: Fix use after free

eng_window_use() uses outbuf->redirect, so the clever code in
eng_outbuf_reconfigure that avoided setting it to NULL to check
if we needed to recreate the redirect was not very clever at all.
This commit is contained in:
Derek Foreman 2016-04-04 13:08:55 -05:00 committed by Mike Blumenkrantz
parent c937248eac
commit 2760afbb0e
1 changed files with 6 additions and 1 deletions

View File

@ -317,17 +317,22 @@ eng_window_resurf(Outbuf *gw)
void
eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EINA_UNUSED)
{
Eina_Bool redirected;
if (!ob->model) ob->model = wobbly_create(0, 0, w, h);
wobbly_resize(ob->model, w, h);
redirected = !!ob->redirect;
if (ob->redirect)
glsym_evas_gl_common_context_unredirect(ob->redirect);
ob->redirect = NULL;
ob->w = w;
ob->h = h;
ob->rot = rot;
eng_window_use(ob);
glsym_evas_gl_common_context_resize(ob->gl_context, w, h, rot);
if (ob->redirect)
if (redirected)
ob->redirect = glsym_evas_gl_common_context_redirect(ob->gl_context);
if (ob->win)