From e464acff7ab83b29291992cca1e3043b8c65823e Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 4 Apr 2009 19:02:01 +0100 Subject: [PATCH] [cogl] cogl_is_*(): Don't dereference an invalid handle; just return FALSE An invalid handle is implicitly not of any type. --- clutter/cogl/common/cogl-handle.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/cogl/common/cogl-handle.h b/clutter/cogl/common/cogl-handle.h index 55e8ecd26..242b187f5 100644 --- a/clutter/cogl/common/cogl-handle.h +++ b/clutter/cogl/common/cogl-handle.h @@ -125,6 +125,9 @@ typedef struct _CoglHandleObject { \ CoglHandleObject *obj = (CoglHandleObject *)handle; \ \ + if (handle == COGL_INVALID_HANDLE) \ + return FALSE; \ + \ return (obj->klass->type == \ _cogl_##type_name##_get_type ()); \ } \