summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunkyeong Kim <jk0430.kim@samsung.com>2016-05-12 16:30:25 +0900
committerJunkyeong Kim <jk0430.kim@samsung.com>2016-05-12 16:50:08 +0900
commitdb58464ed1d0bd9545a29cd7bdaa37774d59c2b0 (patch)
tree64a7db546f584dfd8cf2c47a8d2280aa76ea9978
parentf262dfedbb6840f71651dcdc3172e7eacc4e268b (diff)
downloadlibtbm-db58464ed1d0bd9545a29cd7bdaa37774d59c2b0.tar.gz
libtbm-db58464ed1d0bd9545a29cd7bdaa37774d59c2b0.tar.bz2
libtbm-db58464ed1d0bd9545a29cd7bdaa37774d59c2b0.zip
Change-Id: I6535e460781c60741d47915222f17632ba95222b Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rwxr-xr-xsrc/tbm_surface_internal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c
index 59eac8f..4626d2f 100755
--- a/src/tbm_surface_internal.c
+++ b/src/tbm_surface_internal.c
@@ -1468,6 +1468,12 @@ tbm_internal_surface_dump_buffer(tbm_surface_h surface, const char *type)
ret = tbm_surface_map(surface, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, &info);
TBM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE);
+ if (info.size > buf_info->size) {
+ TBM_LOG("Dump skip. surface over created buffer size(%d, %d)\n", info.size, buf_info->size);
+ tbm_surface_unmap(surface);
+ return;
+ }
+
if (info.format == TBM_FORMAT_ARGB8888 || info.format == TBM_FORMAT_XRGB8888)
postfix = dump_postfix[0];
else