浏览代码

handle the case where the ibus address can't be found. (prevents nasty crash)

Edward Rudd 10 年之前
父节点
当前提交
c7ec9c1d85
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/core/linux/SDL_ibus.c

+ 3 - 0
src/core/linux/SDL_ibus.c

@@ -462,6 +462,9 @@ SDL_IBus_Init(void)
         ibus_addr_file = SDL_strdup(addr_file);
         
         addr = IBus_ReadAddressFromFile(addr_file);
+        if (!addr) {
+            return SDL_FALSE;
+        }
         
         if (inotify_fd < 0) {
             inotify_fd = inotify_init();