[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2006-07-30 20:34:48
Message-ID: 1154291688.884497.4176.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 567994 by aacid:

make nGfxBlendModeNames define return the correct size of the gfxBlendModeNames array \
so it does not access invalid memory when the blend mode is not found. Discovered by \
Krzysztof Kowalczyk


 M  +5 -3      GfxState.cc  


--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/GfxState.cc #567993:567994
@@ -35,10 +35,12 @@
 
 //------------------------------------------------------------------------
 
-static struct {
+struct gfxBlendModeName {
   char *name;
   GfxBlendMode mode;
-} gfxBlendModeNames[] = {
+};
+
+static gfxBlendModeName gfxBlendModeNames[] = {
   { "Normal",     gfxBlendNormal },
   { "Compatible", gfxBlendNormal },
   { "Multiply",   gfxBlendMultiply },
@@ -59,7 +61,7 @@
 };
 
 #define nGfxBlendModeNames \
-          ((int)((sizeof(gfxBlendModeNames) / sizeof(char *))))
+          ((int)((sizeof(gfxBlendModeNames) / sizeof(gfxBlendModeName))))
 
 //------------------------------------------------------------------------
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic