range checking.
[swftools.git] / pdf2swf / xpdf / GfxFont.h
index c67ac29..edd26e5 100644 (file)
@@ -198,7 +198,7 @@ public:
   CharCodeToUnicode *getToUnicode();
 
   // Return the character name associated with <code>.
-  char *getCharName(int code) { return enc[code]; }
+  char *getCharName(int code) { return code>=256?0:enc[code]; }
 
   // Returns true if the PDF font specified an encoding.
   GBool getHasEncoding() { return hasEncoding; }