[cairo-commit] libsvg/src svg_str.c,1.4,1.5
Carl Worth
commit at pdx.freedesktop.org
Fri Jan 21 04:54:38 PST 2005
Committed by: cworth
Update of /cvs/cairo/libsvg/src
In directory gabe:/tmp/cvs-serv30908/src
Modified Files:
svg_str.c
Log Message:
* src/svg_str.c (_svg_str_parse_all_csv_doubles): Fix segfault bug
introduced in last commit.
Index: svg_str.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_str.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svg_str.c 23 Dec 2004 22:00:01 -0000 1.4
+++ svg_str.c 21 Jan 2005 12:54:36 -0000 1.5
@@ -84,14 +84,14 @@
_svg_str_parse_all_csv_doubles (const char *str, double **value, int *num_values, const char **end)
{
svgint_status_t status;
- int size = 5;
+ int size = 0;
*num_values = 0;
*value = NULL;
while (1) {
if (*num_values >= size) {
while (*num_values >= size)
- size *= 2;
+ size = size ? size * 2 : 5;
*value = realloc(*value, size * sizeof(double));
if (*value == NULL)
status = SVG_STATUS_NO_MEMORY;
More information about the cairo-commit
mailing list