[GRASS-SVN] r43633 - grass/branches/releasebranch_6_4/lib/pngdriver

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 22 16:13:44 EDT 2010


Author: neteler
Date: 2010-09-22 20:13:43 +0000 (Wed, 22 Sep 2010)
New Revision: 43633

Modified:
   grass/branches/releasebranch_6_4/lib/pngdriver/pngdriver.h
   grass/branches/releasebranch_6_4/lib/pngdriver/write_bmp.c
Log:
backport: Glynn: Use 64-byte header to ensure frame buffer alignment (trac #937)

Modified: grass/branches/releasebranch_6_4/lib/pngdriver/pngdriver.h
===================================================================
--- grass/branches/releasebranch_6_4/lib/pngdriver/pngdriver.h	2010-09-22 20:11:06 UTC (rev 43632)
+++ grass/branches/releasebranch_6_4/lib/pngdriver/pngdriver.h	2010-09-22 20:13:43 UTC (rev 43633)
@@ -8,7 +8,7 @@
 
 #define FILE_NAME  "map.png"
 
-#define HEADER_SIZE 54
+#define HEADER_SIZE 64
 
 extern char *file_name;
 extern int currentColor;

Modified: grass/branches/releasebranch_6_4/lib/pngdriver/write_bmp.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/pngdriver/write_bmp.c	2010-09-22 20:11:06 UTC (rev 43632)
+++ grass/branches/releasebranch_6_4/lib/pngdriver/write_bmp.c	2010-09-22 20:13:43 UTC (rev 43633)
@@ -59,6 +59,7 @@
     if (!output)
 	G_fatal_error("PNG: couldn't open output file %s", file_name);
 
+    memset(header, 0, sizeof(header));
     make_bmp_header(header);
     fwrite(header, sizeof(header), 1, output);
 



More information about the grass-commit mailing list