From 2dbaaec89641c6fdd2ab1e7975e14b49da5ff1f4 Mon Sep 17 00:00:00 2001 From: Sangjin Lee Date: Tue, 26 Sep 2017 16:04:35 +0900 Subject: [PATCH] Fix to check validation of file Change-Id: Ic5356fa00420f7e713b0a2ff04a0fcf2fc01aac1 --- src/tbm_surface_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 75103dd..d8c67aa 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -2336,13 +2336,13 @@ tbm_surface_internal_capture_shm_buffer(void *ptr, int w, int h, int stride, return 0; } + snprintf(file, sizeof(file), "%s/%s.%s", path , name, dump_postfix[0]); + if (!access(file, 0)) { TBM_LOG_E("can't capture buffer, exist file %sTBM_FORMAT_XRGB8888", file); return 0; } - snprintf(file, sizeof(file), "%s/%s.%s", path , name, dump_postfix[0]); - _tbm_surface_internal_dump_file_png(file, ptr, stride, h, 0); TBM_TRACE("Capture %s \n", file); -- 2.7.4