Hello,

Attached is a patch that sets a correct size (17) for
nGfxBlendModeNames instead of incorrect 34 (the current value).

Incorrect size will cause accessing invalid memory when traversing the
gfxBlendModeNames array in GfxState::parseBlendMode().

This is filed as bug 7688 (https://bugs.freedesktop.org/show_bug.cgi?id=7688).

Regards,

-- kjk (http://blog.kowalczyk.info)
Index: GfxState.cc
===================================================================
--- GfxState.cc (revision 23)
+++ GfxState.cc (working copy)
@@ -62,10 +62,12 @@
 
 //------------------------------------------------------------------------
 
+#define nGfxBlendModeNames 17
+
 static struct {
  char *name;
  GfxBlendMode mode;
-} gfxBlendModeNames[] = {
+} gfxBlendModeNames[nGfxBlendModeNames] = {
   { "Normal",     gfxBlendNormal },
   { "Compatible", gfxBlendNormal },
   { "Multiply",   gfxBlendMultiply },
@@ -84,9 +86,6 @@
   { "Color",      gfxBlendColor },
   { "Luminosity", gfxBlendLuminosity }
 };
-
-#define nGfxBlendModeNames \
-          ((int)((sizeof(gfxBlendModeNames) / sizeof(char *))))
         
 //------------------------------------------------------------------------
 // 
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to