OSDN Git Service

Add basic CONTRIBUTING file
[android-x86/external-libdrm.git] / xf86drmMode.c
index 15957ff..9a15b5e 100644 (file)
  * platforms find which headers to include to get uint32_t
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <limits.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -831,8 +827,7 @@ int drmCheckModesettingSupported(const char *busid)
        }
 #elif defined(__DragonFly__)
        return 0;
-#endif
-#ifdef __OpenBSD__
+#elif defined(__OpenBSD__)
        int     fd;
        struct drm_mode_card_res res;
        drmModeResPtr r = 0;
@@ -1313,6 +1308,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
        if (!req)
                return -EINVAL;
 
+       if (object_id == 0 || property_id == 0)
+               return -EINVAL;
+
        if (req->cursor >= req->size_items) {
                drmModeAtomicReqItemPtr new;