(fc_decode_prop): Fix for the case of too large VAL.
authorhanda <handa>
Wed, 21 Mar 2012 06:41:01 +0000 (06:41 +0000)
committerhanda <handa>
Wed, 21 Mar 2012 06:41:01 +0000 (06:41 +0000)
src/font-ft.c

index 771ef56..1a993c1 100644 (file)
@@ -371,11 +371,12 @@ fc_decode_prop (int val, FC_vs_M17N_font_prop *table, int size)
          break;
       i++;
     }
-  else
+  else if (val > table[i].fc_value)
     {
-      for (; i < size; i++)
-       if (val <= table[i].fc_value)
+      for (i++; i < size; i++)
+       if (val < table[i].fc_value)
          break;
+      i--;
     }
   return table[i].sym;
 }