From 17fef2fe4ddcba8d0811922f012add50109eb0e2 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Sun, 17 Oct 2010 11:56:49 +0200 Subject: [PATCH] path: Make _cairo_path_fixed_last_op assert on empty path _cairo_path_fixed_last_op should now only be used on non-empty path (to test if the previous operation was a line_to). --- src/cairo-path-fixed.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c index 5b2bcbef6..812728bc4 100644 --- a/src/cairo-path-fixed.c +++ b/src/cairo-path-fixed.c @@ -375,8 +375,7 @@ _cairo_path_fixed_last_op (cairo_path_fixed_t *path) cairo_path_buf_t *buf; buf = cairo_path_tail (path); - if (buf->num_ops == 0) - return -1; + assert (buf->num_ops != 0); return buf->op[buf->num_ops - 1]; }