diff options
author | Akira TAGOH <akira@tagoh.org> | 2016-07-08 14:16:49 +0900 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2016-07-08 14:18:35 +0900 |
commit | 99645ff9eecbf2178199aa940703fbe8ed275867 (patch) | |
tree | 586130ac9c7a2fe6097ebc796faf3b9c209f1964 /src | |
parent | a34db434c6a81f5286af07fabfef874492edb163 (diff) |
Bug 96676 - Check range of FcWeightFromOpenType argument
Fix a crash issue when FcWeightFromOpenType() gets a number more than it expects.
Diffstat (limited to 'src')
-rw-r--r-- | src/fcweight.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fcweight.c b/src/fcweight.c index 1a3b6081..036a518e 100644 --- a/src/fcweight.c +++ b/src/fcweight.c @@ -75,6 +75,7 @@ FcWeightFromOpenType (int ot_weight) case 9: ot_weight = 900; break; } } + ot_weight = FC_MIN (ot_weight, map[(sizeof (map) / sizeof (map[0])) - 1].ot); for (i = 1; ot_weight > map[i].ot; i++) ; |