Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22e984b

Browse files
committed
Fix #2016: reading memory past the end of a C++ std::vector
1 parent a54e8b3 commit 22e984b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ttconv/pprdrv_tt2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ void ttfont_add_glyph_dependencies(struct TTFONT *font, std::vector<int>& glyph_
700700

701701
std::vector<int>::iterator insertion =
702702
std::lower_bound(glyph_ids.begin(), glyph_ids.end(), gind);
703-
if (*insertion != gind)
703+
if (insertion == glyph_ids.end() || *insertion != gind)
704704
{
705705
glyph_ids.insert(insertion, gind);
706706
glyph_stack.push(gind);

0 commit comments

Comments
 (0)