summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongseong Hwang <dongseong.hwang@intel.com>2018-08-13 17:26:18 -0700
committerDongseong Hwang <dongseong.hwang@intel.com>2018-08-13 17:26:18 -0700
commite5411250da60dd3f2b96871a05f90780b5adca10 (patch)
tree43cab56728ba3a419834b6d592db8182f6b3c6ad
parent9dcce71e603616ee7a54707e932f962cdf8fb20a (diff)
cube-tex: close the fd after EGLImage creation.
EGLImage takes the fd ownership.
-rw-r--r--cube-tex.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cube-tex.c b/cube-tex.c
index 09f18e3..c74c183 100644
--- a/cube-tex.c
+++ b/cube-tex.c
@@ -363,6 +363,7 @@ static int init_tex_rgba(void)
egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);
egl->eglDestroyImageKHR(egl->display, img);
+ close(fd);
return 0;
}
@@ -429,6 +430,7 @@ static int init_tex_nv12_2img(void)
egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img_y);
egl->eglDestroyImageKHR(egl->display, img_y);
+ close(fd_y);
/* UV plane texture: */
img_uv = egl->eglCreateImageKHR(egl->display, EGL_NO_CONTEXT,
@@ -443,6 +445,7 @@ static int init_tex_nv12_2img(void)
egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img_uv);
egl->eglDestroyImageKHR(egl->display, img_uv);
+ close(fd_uv);
return 0;
}
@@ -499,6 +502,8 @@ static int init_tex_nv12_1img(void)
egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);
egl->eglDestroyImageKHR(egl->display, img);
+ close(fd_y);
+ close(fd_uv);
return 0;
}