[poppler] poppler/poppler: GfxState.cc,1.13,1.14

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jul 30 13:31:33 PDT 2006


Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv32551/poppler

Modified Files:
	GfxState.cc 
Log Message:
        * poppler/GfxState.cc: make nGfxBlendModeNames define return the
        correct size of the gfxBlendModeNames array so it does not access
        invalid memory areas when the blend mode is not found. Discovered by
        Krzysztof Kowalczyk


Index: GfxState.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/GfxState.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- GfxState.cc	16 Jul 2006 18:22:23 -0000	1.13
+++ GfxState.cc	30 Jul 2006 20:31:31 -0000	1.14
@@ -62,10 +62,12 @@
 
 //------------------------------------------------------------------------
 
-static struct {
- char *name;
- GfxBlendMode mode;
-} gfxBlendModeNames[] = {
+struct gfxBlendModeName {
+  char *name;
+  GfxBlendMode mode;
+};
+
+static gfxBlendModeName gfxBlendModeNames[] = {
   { "Normal",     gfxBlendNormal },
   { "Compatible", gfxBlendNormal },
   { "Multiply",   gfxBlendMultiply },
@@ -86,7 +88,7 @@
 };
 
 #define nGfxBlendModeNames \
-          ((int)((sizeof(gfxBlendModeNames) / sizeof(char *))))
+          ((int)((sizeof(gfxBlendModeNames) / sizeof(gfxBlendModeName))))
 	 
 //------------------------------------------------------------------------
 // 



More information about the poppler mailing list