virgl/egl: fix null pointer dereference 1

Fixes https://gitlab.freedesktop.org/virgl/virglrenderer/issues/65

Reviewed-by Gert Wollny <gert.wollny@collabora.com>
macos/master
Gurchetan Singh 5 years ago
parent 910540dd50
commit e30d1ef975
  1. 6
      src/virglrenderer.c

@ -393,6 +393,9 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
int virgl_renderer_get_fd_for_texture(uint32_t tex_id, int *fd)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture(egl, tex_id, fd);
#else
return -1;
@ -402,6 +405,9 @@ int virgl_renderer_get_fd_for_texture(uint32_t tex_id, int *fd)
int virgl_renderer_get_fd_for_texture2(uint32_t tex_id, int *fd, int *stride, int *offset)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture2(egl, tex_id, fd, stride, offset);
#else
return -1;

Loading…
Cancel
Save