r20622 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 16 21:09:56 UTC 2015


Author: jghali
Date: Wed Dec 16 21:09:56 2015
New Revision: 20622

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20622
Log:
#13605: Scribus crashes immediately on opening a particular file

Modified:
    branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp

Modified: branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20622&path=/branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ branches/Version14x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Wed Dec 16 21:09:56 2015
@@ -1519,6 +1519,14 @@
 		QMap<PageItem*, int>::Iterator it;
 		for (it = groupIDF.begin(); it != groupIDF.end(); ++it)
 		{
+			int itemIndex = it.value();
+			if (itemIndex >= m_Doc->FrameItems.count())
+			{
+				qDebug() << "scribus134format: group corruption detected";
+				it.key()->isGroupControl = false;
+				it.key()->setFillColor(CommonStrings::None);
+				continue;
+			}
 			it.key()->groupsLastItem = m_Doc->FrameItems.at(it.value());
 		}
 	}
@@ -1527,6 +1535,14 @@
 		QMap<PageItem*, int>::Iterator it;
 		for (it = groupID.begin(); it != groupID.end(); ++it)
 		{
+			int itemIndex = it.value();
+			if (itemIndex >= m_Doc->DocItems.count())
+			{
+				qDebug() << "scribus134format: group corruption detected";
+				it.key()->isGroupControl = false;
+				it.key()->setFillColor(CommonStrings::None);
+				continue;
+			}
 			it.key()->groupsLastItem = m_Doc->DocItems.at(it.value());
 		}
 	}
@@ -1535,6 +1551,14 @@
 		QMap<PageItem*, int>::Iterator it;
 		for (it = groupIDM.begin(); it != groupIDM.end(); ++it)
 		{
+			int itemIndex = it.value();
+			if (itemIndex >= m_Doc->MasterItems.count())
+			{
+				qDebug() << "scribus134format: group corruption detected";
+				it.key()->isGroupControl = false;
+				it.key()->setFillColor(CommonStrings::None);
+				continue;
+			}
 			it.key()->groupsLastItem = m_Doc->MasterItems.at(it.value());
 		}
 	}
@@ -3396,7 +3420,15 @@
 		QMap<PageItem*, int>::Iterator it;
 		for (it = groupID.begin(); it != groupID.end(); ++it)
 		{
-			it.key()->groupsLastItem = m_Doc->Items->at(it.value());
+			int itemIndex = it.value();
+			if (itemIndex >= m_Doc->Items->count())
+			{
+				qDebug() << "scribus134format: group corruption detected";
+				it.key()->isGroupControl = false;
+				it.key()->setFillColor(CommonStrings::None);
+				continue;
+			}
+			it.key()->groupsLastItem = m_Doc->Items->at(itemIndex);
 		}
 	}
 	




More information about the scribus-commit mailing list