ecore-evas: Fix error handling issues in wayland_shm engine
authorChris Michael <cpmichael@osg.samsung.com>
Thu, 30 Jun 2016 14:51:29 +0000 (10:51 -0400)
committerChris Michael <cpmichael@osg.samsung.com>
Thu, 30 Jun 2016 14:51:29 +0000 (10:51 -0400)
This patch fixes 2 Coverity issues where engine_info_set was being
called, but the return was never being checked.

Fixes Coverity CID1357141 and CID1357142

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c

index e18c06c..05e60f6 100644 (file)
@@ -443,7 +443,8 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
              if ((!einfo->info.wl_surface) || (einfo->info.wl_surface != surf))
                {
                   einfo->info.wl_surface = surf;
-                  evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+                  if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+                    ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
                   evas_damage_rectangle_add(ee->evas, 0, 0, ee->w + fw, ee->h + fh);
                }
           }
@@ -482,7 +483,10 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
    if (einfo)
      {
         einfo->info.wl_surface = NULL;
-        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+        if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+          {
+             ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
+          }
      }
 
    if (wdata->win)