|
|
@@ -906,7 +906,7 @@ bool CheckCmapSubtable4(const void * pCmapSubtable4, const void * pCmapEnd /*, u |
|
|
if (length < sizeof(Sfnt::CmapSubTableFormat4))
|
|
|
return false;
|
|
|
uint16 nRanges = be::swap(pTable4->seg_count_x2) >> 1;
|
|
|
- if (length < sizeof(Sfnt::CmapSubTableFormat4) + 4 * nRanges * sizeof(uint16))
|
|
|
+ if (!nRanges || length < sizeof(Sfnt::CmapSubTableFormat4) + 4 * nRanges * sizeof(uint16))
|
|
|
return false;
|
|
|
// check last range is properly terminated
|
|
|
uint16 chEnd = be::peek<uint16>(pTable4->end_code + nRanges - 1);
|
|
|
|
0 comments on commit
c36204c