Don't return error, if fail to get handle in tbm_surface_internal_get_info 15/59415/5
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 15 Feb 2016 09:53:51 +0000 (18:53 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 16 Feb 2016 03:01:41 +0000 (12:01 +0900)
Change-Id: Idbbdf4acf5dea6b55803b4ef46bdc23e15033b55
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
src/tbm_surface_internal.c

index 48ef0ce..f8d1b13 100644 (file)
@@ -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();