[GRASS-SVN] r46945 - grass/branches/develbranch_6/lib/cairodriver

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 4 03:42:49 EDT 2011


Author: martinl
Date: 2011-07-04 00:42:49 -0700 (Mon, 04 Jul 2011)
New Revision: 46945

Modified:
   grass/branches/develbranch_6/lib/cairodriver/read_ppm.c
Log:
cairodriver: fix segfault for ppm (GRASS_PNG_READ=TRUE)


Modified: grass/branches/develbranch_6/lib/cairodriver/read_ppm.c
===================================================================
--- grass/branches/develbranch_6/lib/cairodriver/read_ppm.c	2011-07-04 07:39:49 UTC (rev 46944)
+++ grass/branches/develbranch_6/lib/cairodriver/read_ppm.c	2011-07-04 07:42:49 UTC (rev 46945)
@@ -23,14 +23,14 @@
 
     mask_name[strlen(mask_name) - 2] = 'g';
 
-    input = fopen(mask_name, "rb");
-    if (!input)
+    mask = fopen(mask_name, "rb");
+    if (!mask)
 	G_fatal_error("cairo: couldn't open input mask file %s", mask_name);
 
-    if (fscanf(input, "P5 %d %d %d", &i_width, &i_height, &maxval) != 3)
+    if (fscanf(mask, "P5 %d %d %d", &i_width, &i_height, &maxval) != 3)
 	G_fatal_error("cairo: invalid input mask file %s", mask_name);
 
-    fgetc(input);
+    fgetc(mask);
 
     if (i_width != width || i_height != height)
 	G_fatal_error



More information about the grass-commit mailing list