Fix crash when loading bad fill data (#2519)
* Ignore bad intersection data * Fix crash removing unwanted intersect data
This commit is contained in:
parent
b5dd396b49
commit
f2ace2130c
1 changed files with 12 additions and 9 deletions
|
@ -457,8 +457,9 @@ static void cleanNextIntersection(const VIList<Intersection> &interList,
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void TVectorImage::Imp::eraseEdgeFromStroke(IntersectedStroke *is) {
|
||||
if (is->m_edge.m_index >=
|
||||
0) // elimino il puntatore all'edge nella lista della VIStroke
|
||||
if (is->m_edge.m_index >= 0 &&
|
||||
is->m_edge.m_index < m_strokes.size()) // elimino il puntatore all'edge
|
||||
// nella lista della VIStroke
|
||||
{
|
||||
VIStroke *s;
|
||||
s = m_strokes[is->m_edge.m_index];
|
||||
|
@ -602,7 +603,10 @@ void TVectorImage::Imp::doEraseIntersection(int index,
|
|||
p1 = p1->next();
|
||||
}
|
||||
|
||||
if (deleteIt) delete deleteIt;
|
||||
if (deleteIt) {
|
||||
m_intersectionData->m_autocloseMap.erase(index);
|
||||
delete deleteIt;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -771,8 +775,7 @@ for (UINT ii=0; ii<branchCount; ii++)
|
|||
if (v[i].m_currInter >=
|
||||
size) // pezza per immagine corrotte...evito crash
|
||||
{
|
||||
intList.clear();
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
branchesBefore[v[i].m_currInter] = i;
|
||||
|
@ -787,7 +790,7 @@ for (UINT ii=0; ii<branchCount; ii++)
|
|||
currBranch->m_edge.m_styleId = b.m_style;
|
||||
// assert(b.m_style<100);
|
||||
currBranch->m_edge.m_index = b.m_strokeIndex;
|
||||
if (b.m_strokeIndex >= 0)
|
||||
if (b.m_strokeIndex >= 0 && b.m_strokeIndex < m_strokes.size())
|
||||
currBranch->m_edge.m_s = m_strokes[b.m_strokeIndex]->m_s;
|
||||
else
|
||||
currBranch->m_edge.m_s = 0;
|
||||
|
@ -840,7 +843,7 @@ assert(v[b.m_nextBranch].m_nextBranch==i);
|
|||
while (v[j].m_strokeIndex < 0 &&
|
||||
((j > 0 && v[j].m_currInter == v[j - 1].m_currInter) || j == 0))
|
||||
j--;
|
||||
if (v[j].m_strokeIndex >= 0)
|
||||
if (v[j].m_strokeIndex >= 0 && v[j].m_strokeIndex < m_strokes.size())
|
||||
currInt->m_intersection =
|
||||
m_strokes[v[j].m_strokeIndex]->m_s->getPoint(v[j].m_w);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue