Test for end() after lower_bound call before dereferencing!

--HG--
branch : WINDOWSPORT
This commit is contained in:
Jean-Francois Dockes 2015-09-01 14:44:30 +02:00
parent 815da2f590
commit 82295328cc

View File

@ -142,6 +142,8 @@ static inline int whatcc(unsigned int c)
} else {
vector<unsigned int>::iterator it =
lower_bound(vpuncblocks.begin(), vpuncblocks.end(), c);
if (it == vpuncblocks.end())
return LETTER;
if (c == *it)
return SPACE;
if ((it - vpuncblocks.begin()) % 2 == 1) {