summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_fb.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:51:34 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:53:01 -0400
commit3d71a10891c31de9c667f15f8f37371a5664f759 (patch)
treecc2ff822e9ffa1636ad284d6b3beb8c74146cac6 /src/lib/ecore_drm/ecore_drm_fb.c
parenta01b2434054db1f7de9087634227c52abb48e291 (diff)
ecore-drm: add safety checks to all EAPI functions
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_fb.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_fb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c
index a3e3b37f85..982f962f7c 100644
--- a/src/lib/ecore_drm/ecore_drm_fb.c
+++ b/src/lib/ecore_drm/ecore_drm_fb.c
@@ -55,6 +55,8 @@ ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height)
55 struct drm_mode_destroy_dumb darg; 55 struct drm_mode_destroy_dumb darg;
56 struct drm_mode_map_dumb marg; 56 struct drm_mode_map_dumb marg;
57 57
58 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
59 EINA_SAFETY_ON_TRUE_RETURN_VAL((width < 1) || (height < 1), NULL);
58 if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL; 60 if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL;
59 61
60 memset(&carg, 0, sizeof(struct drm_mode_create_dumb)); 62 memset(&carg, 0, sizeof(struct drm_mode_create_dumb));
@@ -139,6 +141,8 @@ EAPI void
139ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count) 141ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count)
140{ 142{
141 EINA_SAFETY_ON_NULL_RETURN(fb); 143 EINA_SAFETY_ON_NULL_RETURN(fb);
144 EINA_SAFETY_ON_NULL_RETURN(rects);
145 EINA_SAFETY_ON_TRUE_RETURN(!count);
142 146
143#ifdef DRM_MODE_FEATURE_DIRTYFB 147#ifdef DRM_MODE_FEATURE_DIRTYFB
144 drmModeClip *clip; 148 drmModeClip *clip;