summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-script-surface.c1
-rw-r--r--util/cairo-trace/trace.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-script-surface.c b/src/cairo-script-surface.c
index e715cae50..7db7dc5b0 100644
--- a/src/cairo-script-surface.c
+++ b/src/cairo-script-surface.c
@@ -262,6 +262,7 @@ _bitmap_next_id (struct _bitmap *b,
prev = &b->next;
b = b->next;
} while (b != NULL);
+ assert (prev != NULL);
bb = _cairo_malloc (sizeof (struct _bitmap));
if (unlikely (bb == NULL))
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 3c056134e..87b2df46e 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -299,8 +299,10 @@ _type_next_token (Type *t)
prev = &b->next;
b = b->next;
}
+ assert (prev != NULL);
bb = malloc (sizeof (struct _bitmap));
+
*prev = bb;
bb->next = b;
bb->min = min;