r23663 by craig - Fix logic error in colorspace data and operator= guard against deleting

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 26 20:42:12 UTC 2020


Author: craig
Date: Sun Apr 26 20:42:12 2020
New Revision: 23663

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23663
Log:
Fix logic error in colorspace data and operator= guard against deleting
self

Modified:
    trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
    trunk/Scribus/scribus/desaxe/digester.cpp

Modified: trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23663&path=/trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	Sun Apr 26 20:42:12 2020
@@ -71,11 +71,13 @@
 	if (transform)
 	{
 		success = transform.apply(dataIn, dataOut, numElems);
-		if (!this->hasAlphaChannel() && data.hasAlphaChannel())
-			data.flattenAlpha(dataOut, numElems);
-		if (lastTrans && (transform != *lastTrans))
-			*lastTrans = transform;
-		success = true;
+		if (success)
+		{
+			if (!this->hasAlphaChannel() && data.hasAlphaChannel())
+				data.flattenAlpha(dataOut, numElems);
+			if (lastTrans && (transform != *lastTrans))
+				*lastTrans = transform;
+		}
 	}
 	return success;
 }

Modified: trunk/Scribus/scribus/desaxe/digester.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23663&path=/trunk/Scribus/scribus/desaxe/digester.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/digester.cpp	(original)
+++ trunk/Scribus/scribus/desaxe/digester.cpp	Sun Apr 26 20:42:12 2020
@@ -108,6 +108,8 @@
 
 Digester& Digester::operator=(const Digester& other)
 {
+	if (&other == this)
+		return *this;
 	delete m_state;
 	m_state = new RuleState(*other.m_state);
 	m_objects = other.m_objects;




More information about the scribus-commit mailing list