[lasem] [SVG] Fix memory corruption when duplicating dash array attribute.



commit f170c01acaf609aa497c2d1a0d7a833c5c4df909
Author: Emmanuel Pacaud <emmanuel pacaud lapp in2p3 fr>
Date:   Mon May 18 16:01:27 2009 +0200

    [SVG] Fix memory corruption when duplicating dash array attribute.
---
 src/lsmsvgattributes.c |    2 +-
 src/lsmsvggraphic.c    |    2 +-
 src/lsmsvgview.c       |    1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lsmsvgattributes.c b/src/lsmsvgattributes.c
index eb0485e..c213fc5 100644
--- a/src/lsmsvgattributes.c
+++ b/src/lsmsvgattributes.c
@@ -71,7 +71,7 @@ lsm_svg_dash_array_duplicate (const LsmSvgDashArray *origin)
 	duplicate = lsm_svg_dash_array_new (origin->n_dashes);
 
 	if (duplicate != &lsm_svg_dash_array_null)
-		memcpy (duplicate->dashes, origin->dashes, sizeof (double) * origin->n_dashes);
+		memcpy (duplicate->dashes, origin->dashes, sizeof (LsmSvgLength) * origin->n_dashes);
 
 	return duplicate;
 }
diff --git a/src/lsmsvggraphic.c b/src/lsmsvggraphic.c
index b2c557e..5c99424 100644
--- a/src/lsmsvggraphic.c
+++ b/src/lsmsvggraphic.c
@@ -140,7 +140,7 @@ _graphic_render (LsmSvgElement *self, LsmSvgView *view)
 {
 	LsmDomNode *node;
 
-	lsm_debug ("[LsmSvgGraphic::_graphic_render");
+	lsm_debug ("[LsmSvgGraphic::_graphic_render]");
 
 	for (node = LSM_DOM_NODE (self)->first_child; node != NULL; node = node->next_sibling) {
 		if (LSM_IS_SVG_ELEMENT (node))
diff --git a/src/lsmsvgview.c b/src/lsmsvgview.c
index 7087217..764a3f5 100644
--- a/src/lsmsvgview.c
+++ b/src/lsmsvgview.c
@@ -1025,7 +1025,6 @@ _paint (LsmSvgView *view)
 
 			dash_offset = lsm_svg_view_normalize_length (view, &stroke->dash_offset.length,
 								     LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
-
 			dashes = g_new(double, stroke->dash_array.value->n_dashes);
 			for (i = 0; i < stroke->dash_array.value->n_dashes; i++)
 				dashes[i] = lsm_svg_view_normalize_length (view,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]