add size checking at dump 14/69214/2 accepted/tizen/ivi/20160513.004612 accepted/tizen/mobile/20160513.004645 accepted/tizen/tv/20160513.004606 accepted/tizen/wearable/20160513.004558 submit/tizen/20160512.075824
authorJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 12 May 2016 07:30:25 +0000 (16:30 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 12 May 2016 07:50:08 +0000 (16:50 +0900)
Change-Id: I6535e460781c60741d47915222f17632ba95222b
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tbm_surface_internal.c

index 59eac8f..4626d2f 100755 (executable)
@@ -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