r15135 by jghali - some fixes for lcms2 color engine implementation

scribus-commit scribus-commit at lists.scribus.net
Sat May 29 10:00:23 CEST 2010


Revision: 15135
Author: jghali
Date: 2010-05-29T07:57:58.442181Z
Commit message: some fixes for lcms2 color engine implementation

Changeset: 
M  /trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
M  /trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp

Diffs:
Index: scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
===================================================================
--- scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	(revision 15134)
+++ scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	(revision 15135)
@@ -90,10 +90,12 @@
 				descSize = cmsGetProfileInfo(hIn, cmsInfoDescription, "en", "US", descData, descSize);
 				if (descSize > 0)
 				{
+					uint stringLen = descSize / sizeof(wchar_t);
+					descData[stringLen] = 0;
 					if (sizeof(wchar_t) == sizeof(QChar)) {
-						profileInfo.description = QString::fromUtf16((ushort *) descData, descSize / sizeof(wchar_t));
+						profileInfo.description = QString::fromUtf16((ushort *) descData);
 					} else {
-						profileInfo.description = QString::fromUcs4((uint *) descData, descSize / sizeof(wchar_t));
+						profileInfo.description = QString::fromUcs4((uint *) descData);
 					}
 					free(descData);
 				}
Index: scribus/colormgmt/sclcms2colorprofileimpl.cpp
===================================================================
--- scribus/colormgmt/sclcms2colorprofileimpl.cpp	(revision 15134)
+++ scribus/colormgmt/sclcms2colorprofileimpl.cpp	(revision 15135)
@@ -51,10 +51,12 @@
 				descSize = cmsGetProfileInfo(m_profileHandle, cmsInfoDescription, "en", "US", descData, descSize);
 				if (descSize > 0)
 				{
+					uint stringLen = descSize / sizeof(wchar_t);
+					descData[stringLen] = 0;
 					if (sizeof(wchar_t) == sizeof(QChar)) {
-						m_productDescription = QString::fromUtf16((ushort *) descData, descSize / sizeof(wchar_t));
+						m_productDescription = QString::fromUtf16((ushort *) descData);
 					} else {
-						m_productDescription = QString::fromUcs4((uint *) descData, descSize / sizeof(wchar_t));
+						m_productDescription = QString::fromUcs4((uint *) descData);
 					}
 					free(descData);
 				}




More information about the scribus-commit mailing list