[cairo-commit] cairo/src cairo-path-data.c,1.10,1.11

Behdad Esfahbod commit at pdx.freedesktop.org
Sat Aug 13 01:17:08 PDT 2005


Committed by: behdad

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv31211/src

Modified Files:
	cairo-path-data.c 
Log Message:
2005-08-13  Behdad Esfahbod  <behdad at behdad.org>

        * src/cairo-path-data.c (_cairo_path_data_append_to_context):
        Move checks for invalid number of points before the calls that
        use the points.



Index: cairo-path-data.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-path-data.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo-path-data.c	5 Aug 2005 17:30:31 -0000	1.10
+++ cairo-path-data.c	13 Aug 2005 08:17:06 -0000	1.11
@@ -454,29 +454,29 @@
 	p = &path->data[i];
 	switch (p->header.type) {
 	case CAIRO_PATH_MOVE_TO:
-	    cairo_move_to (cr,
-			   p[1].point.x, p[1].point.y);
 	    if (p->header.length != 2)
 		return CAIRO_STATUS_INVALID_PATH_DATA;
+	    cairo_move_to (cr,
+			   p[1].point.x, p[1].point.y);
 	    break;
 	case CAIRO_PATH_LINE_TO:
-	    cairo_line_to (cr,
-			   p[1].point.x, p[1].point.y);
 	    if (p->header.length != 2)
 		return CAIRO_STATUS_INVALID_PATH_DATA;
+	    cairo_line_to (cr,
+			   p[1].point.x, p[1].point.y);
 	    break;
 	case CAIRO_PATH_CURVE_TO:
+	    if (p->header.length != 4)
+		return CAIRO_STATUS_INVALID_PATH_DATA;
 	    cairo_curve_to (cr,
 			    p[1].point.x, p[1].point.y,
 			    p[2].point.x, p[2].point.y,
 			    p[3].point.x, p[3].point.y);
-	    if (p->header.length != 4)
-		return CAIRO_STATUS_INVALID_PATH_DATA;
 	    break;
 	case CAIRO_PATH_CLOSE_PATH:
-	    cairo_close_path (cr);
 	    if (p->header.length != 1)
 		return CAIRO_STATUS_INVALID_PATH_DATA;
+	    cairo_close_path (cr);
 	    break;
 	default:
 	    return CAIRO_STATUS_INVALID_PATH_DATA;




More information about the cairo-commit mailing list