Fix image checker to resolve C# crash
[platform/core/api/system-settings.git] / libutil / sstu.c
index 109421d..633178e 100644 (file)
@@ -73,14 +73,21 @@ static char* _get_main_font_family(char *alias)
 
        /* do matching */
        set = FcFontSort(font_config, pat, FcTrue, NULL, &res);
-       if (set) {
-               if (0 < set->nfont) {
-                       FcPatternGetString(set->fonts[0], FC_FAMILY, 0, &family);
+       do {
+               if (set && 0 < set->nfont) {
+                       int result = FcPatternGetString(set->fonts[0], FC_FAMILY, 0, &family);
+                       if (FcResultMatch != result) {
+                               ERR("FcPatternGetString() Fail(%d)", result);
+                               ret = NULL;
+                               break;
+                       }
                        if (family)
                                ret = strdup((char*)family);
                }
+       } while(0);
+
+       if (set)
                FcFontSetDestroy(set);
-       }
 
        FcPatternDestroy(pat);
        FcConfigDestroy(font_config);
@@ -93,12 +100,12 @@ API bool sstu_is_valid_image(const char *path)
        void *ee;
        void *evas;
 
-       if (ecore_evas_init()) {
+       if (0 == ecore_evas_init()) {
                ERR("ecore_evas_init() Fail");
                return false;
        }
 
-       ee = ecore_evas_new(NULL, 0, 0, 100, 100, NULL);
+       ee = ecore_evas_buffer_new(100, 100);
        evas = ecore_evas_get(ee);
 
        void *img = evas_object_image_add(evas);