Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ui/gtk: making dmabuf NULL when it's released.
Set vc->gfx.guest_fb.dmabuf to NULL to prevent any further access
to it after the dmabuf is released.

v2: move declaration of vc inside ifdef

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230627005316.5627-1-dongwon.kim@intel.com>
  • Loading branch information
downor authored and elmarco committed Jun 27, 2023
1 parent 7b41ca8 commit 2fc2807
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/gtk.c
Expand Up @@ -583,7 +583,12 @@ static void gd_gl_release_dmabuf(DisplayChangeListener *dcl,
QemuDmaBuf *dmabuf)
{
#ifdef CONFIG_GBM
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);

egl_dmabuf_release_texture(dmabuf);
if (vc->gfx.guest_fb.dmabuf == dmabuf) {
vc->gfx.guest_fb.dmabuf = NULL;
}
#endif
}

Expand Down

0 comments on commit 2fc2807

Please sign in to comment.