From d38bee9f125e4b13bc41cbd2a85b7cccd76cd2a5 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 15 Feb 2016 18:53:51 +0900 Subject: [PATCH] Don't return error, if fail to get handle in tbm_surface_internal_get_info Change-Id: Idbbdf4acf5dea6b55803b4ef46bdc23e15033b55 Signed-off-by: Changyeon Lee --- src/tbm_surface_internal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 48ef0ce..f8d1b13 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -853,10 +853,6 @@ int tbm_surface_internal_get_info(tbm_surface_h surface, int opt, tbm_surface_in } else { for (i = 0; i < surf->num_bos; i++) { bo_handles[i] = tbm_bo_get_handle(surf->bos[i], TBM_DEVICE_CPU); - if (bo_handles[i].ptr == NULL) { - _tbm_surface_mutex_unlock(); - return 0; - } } } @@ -864,7 +860,9 @@ int tbm_surface_internal_get_info(tbm_surface_h surface, int opt, tbm_surface_in info->planes[i].size = surf->info.planes[i].size; info->planes[i].offset = surf->info.planes[i].offset; info->planes[i].stride = surf->info.planes[i].stride; - info->planes[i].ptr = bo_handles[surf->planes_bo_idx[i]].ptr + surf->info.planes[i].offset; + + if (bo_handles[surf->planes_bo_idx[i]].ptr) + info->planes[i].ptr = bo_handles[surf->planes_bo_idx[i]].ptr + surf->info.planes[i].offset; } _tbm_surface_mutex_unlock(); -- 2.7.4