r23545 by jghali - #16079: Copy the full codeToGID table <Pontobart>

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 30 22:36:03 UTC 2020


Author: jghali
Date: Mon Mar 30 22:36:03 2020
New Revision: 23545

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23545
Log:
#16079: Copy the full codeToGID table <Pontobart>

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23545&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	Mon Mar 30 22:36:03 2020
@@ -3054,9 +3054,8 @@
 		case fontCIDType0COT:
 			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
 				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
-				codeToGID = (int *)gmallocn(n, sizeof(int));
-				memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
-				n * sizeof(int));
+				codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
+				memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
 			} else {
 				codeToGID = nullptr;
 				n = 0;
@@ -3079,9 +3078,8 @@
 			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
 				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
 				if (n) {
-					codeToGID = (int *)gmallocn(n, sizeof(int));
-					memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
-					n * sizeof(Gushort));
+					codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
+					memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
 				}
 			} else {
 				if (fileName)




More information about the scribus-commit mailing list