[avar] Fix out-of-bound read when input is bigger than all the coords
'i' shouldn't become equal to array's length which as the increament is happened at end of the loop, if the input is bigger than all the table coords, it will be equal to array's length. Fixes https://crbug.com/oss-fuzz/21092
This commit is contained in:
parent
6924e29f62
commit
0d729b4b72
|
@ -79,7 +79,7 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
|
||||||
return value - arrayZ[0].fromCoord + arrayZ[0].toCoord;
|
return value - arrayZ[0].fromCoord + arrayZ[0].toCoord;
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int count = len;
|
unsigned int count = len - 1;
|
||||||
for (i = 1; i < count && value > arrayZ[i].fromCoord; i++)
|
for (i = 1; i < count && value > arrayZ[i].fromCoord; i++)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue