Change-Id: Ie5ea161542e0ea6acddc77dd502bca4e091c27d9
if (!ret && strstr (namelist[n]->d_name, PREFIX_LIB))
{
p = strstr (namelist[n]->d_name, SUFFIX_LIB);
- if (!strcmp (p, SUFFIX_LIB))
+ if (p != NULL)
{
- ret = _tbm_bufmgr_load_module (bufmgr, fd, namelist[n]->d_name);
+ if (!strcmp (p, SUFFIX_LIB))
+ {
+ ret = _tbm_bufmgr_load_module (bufmgr, fd, namelist[n]->d_name);
+ }
}
}
free(namelist[n]);
tbm_format
tbm_surface_get_format (tbm_surface_h surface)
{
- if (surface)
+ if (!surface)
{
#ifdef HAVE_CAPI_0_1_1
set_last_result (TBM_SURFACE_ERROR_INVALID_PARAMETER);
{
_deinit_surface_bufmgr ();
LIST_DELINIT (&g_surface_list);
+ return NULL;
}
}
ret = mgr->backend->surface_get_plane_data (surf, surf->info.width, surf->info.height, surf->info.format, plane_idx, size, offset, pitch);
if (!ret)
+ {
+ pthread_mutex_unlock (&mgr->lock);
return 0;
+ }
pthread_mutex_unlock (&mgr->lock);