Commit 5d34f02f97516cf9bfae3a1b7efaf63ebc85d101

sammy 2010-05-22T23:53:41

Fix a crash in FTCharToGlyphIndexMap::find(). Addresses SF bug #2471550.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/FTCharToGlyphIndexMap.h b/src/FTCharToGlyphIndexMap.h
index 0d09003..70f7904 100644
--- a/src/FTCharToGlyphIndexMap.h
+++ b/src/FTCharToGlyphIndexMap.h
@@ -106,7 +106,8 @@ class FTCharToGlyphIndexMap
             // Find position of char code in buckets
             div_t pos = div(c, FTCharToGlyphIndexMap::BucketSize);
 
-            if(!this->Indices[pos.quot])
+            if (pos.quot >= FTCharToGlyphIndexMap::NumberOfBuckets
+                 || !this->Indices[pos.quot])
             {
                 return 0;
             }