Skip to content

Commit

Permalink
agg: avoid writting beyond the array size
Browse files Browse the repository at this point in the history
Potentially trying to add two new items to an array without enough room left.

CID 991455
  • Loading branch information
stpere committed Jul 3, 2015
1 parent 217e35d commit 03c4178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/agg/src/agg_vcgen_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace agg
//------------------------------------------------------------------------
void vcgen_dash::add_dash(double dash_len, double gap_len)
{
if(m_num_dashes < max_dashes)
if(m_num_dashes < max_dashes - 1)
{
m_total_dash_len += dash_len + gap_len;
m_dashes[m_num_dashes++] = dash_len;
Expand Down

0 comments on commit 03c4178

Please sign in to comment.