crash with safe iterators: attempt to decrement a past-the-end iterator
Change-Id: I4c81125e67c23fb05e98fc6b2f47ed3e49dd29c3
This commit is contained in:
@@ -205,18 +205,21 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
|
|||||||
//Line to merge things into, so we can delete pLine
|
//Line to merge things into, so we can delete pLine
|
||||||
SmNode* pMergeLine = pLineParent->GetSubNode(nLineOffset-1);
|
SmNode* pMergeLine = pLineParent->GetSubNode(nLineOffset-1);
|
||||||
OSL_ENSURE(pMergeLine, "pMergeLine cannot be NULL!");
|
OSL_ENSURE(pMergeLine, "pMergeLine cannot be NULL!");
|
||||||
|
SmCaretPos PosAfterDelete;
|
||||||
//Convert first line to list
|
//Convert first line to list
|
||||||
SmNodeList *pLineList = NodeToList(pMergeLine);
|
SmNodeList *pLineList = NodeToList(pMergeLine);
|
||||||
//Find iterator to patch
|
if(!pLineList->empty()){
|
||||||
SmNodeList::iterator patchPoint = pLineList->end();
|
//Find iterator to patch
|
||||||
--patchPoint;
|
SmNodeList::iterator patchPoint = pLineList->end();
|
||||||
//Convert second line to list
|
--patchPoint;
|
||||||
NodeToList(pLine, pLineList);
|
//Convert second line to list
|
||||||
//Patch the line list
|
NodeToList(pLine, pLineList);
|
||||||
++patchPoint;
|
//Patch the line list
|
||||||
SmCaretPos PosAfterDelete = PatchLineList(pLineList, patchPoint);
|
++patchPoint;
|
||||||
//Parse the line
|
PosAfterDelete = PatchLineList(pLineList, patchPoint);
|
||||||
pLine = SmNodeListParser().Parse(pLineList);
|
//Parse the line
|
||||||
|
pLine = SmNodeListParser().Parse(pLineList);
|
||||||
|
}
|
||||||
delete pLineList;
|
delete pLineList;
|
||||||
pLineParent->SetSubNode(nLineOffset-1, pLine);
|
pLineParent->SetSubNode(nLineOffset-1, pLine);
|
||||||
//Delete the removed line slot
|
//Delete the removed line slot
|
||||||
|
Reference in New Issue
Block a user