agg: avoid writting beyond the array size

Potentially trying to add two new items to an array without enough room left.

CID 991455
This commit is contained in:
Philippe Saint-Pierre
2015-07-03 11:32:45 -04:00
parent 217e35d624
commit 03c41782bb
+1 -1
View File
@@ -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;