Fix to check validation of file 43/152443/2
authorSangjin Lee <lsj119@samsung.com>
Tue, 26 Sep 2017 07:04:35 +0000 (16:04 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 26 Sep 2017 23:08:29 +0000 (23:08 +0000)
Change-Id: Ic5356fa00420f7e713b0a2ff04a0fcf2fc01aac1

src/tbm_surface_internal.c

index 75103dd..d8c67aa 100644 (file)
@@ -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);