View Issue Details

IDProjectCategoryView StatusLast Update
0016079ScribusPDFpublic2020-04-05 19:37
ReporterPontobart Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.6.svn 
Fixed in Version1.5.6.svn 
Summary0016079: Copy the full codeToGID table
DescriptionAt least since poppler 0.19 the CIDToGID table returned from GfxFont is an int* and not a Gushort*. Due to this for some fonts only half of the table got copied and the rest was garbage.

The attached patch fixes this and defensively reduces the number of places where the type information is repeated.
TagsNo tags attached.
PatchYes

Activities

Pontobart

2020-03-30 20:35

reporter  

codeToGID_table_size.diff (1,092 bytes)   
Index: scribus/plugins/import/pdf/slaoutput.cpp
===================================================================
--- scribus/plugins/import/pdf/slaoutput.cpp	(Revision 23544)
+++ scribus/plugins/import/pdf/slaoutput.cpp	(Arbeitskopie)
@@ -3054,9 +3054,9 @@
 		case fontCIDType0COT:
 			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
 				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
-				codeToGID = (int *)gmallocn(n, sizeof(int));
+				codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
 				memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
-				n * sizeof(int));
+				n * sizeof(*codeToGID));
 			} else {
 				codeToGID = nullptr;
 				n = 0;
@@ -3079,9 +3079,9 @@
 			if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
 				n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
 				if (n) {
-					codeToGID = (int *)gmallocn(n, sizeof(int));
+					codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
 					memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
-					n * sizeof(Gushort));
+					n * sizeof(*codeToGID));
 				}
 			} else {
 				if (fileName)
codeToGID_table_size.diff (1,092 bytes)   

jghali

2020-03-30 22:36

administrator   ~0047483

Applied, thanks!

Issue History

Date Modified Username Field Change
2020-03-30 20:35 Pontobart New Issue
2020-03-30 20:35 Pontobart File Added: codeToGID_table_size.diff
2020-03-30 22:36 jghali Assigned To => jghali
2020-03-30 22:36 jghali Status new => resolved
2020-03-30 22:36 jghali Resolution open => fixed
2020-03-30 22:36 jghali Fixed in Version => 1.5.6.svn
2020-03-30 22:36 jghali Note Added: 0047483
2020-04-05 19:37 cbradney Status resolved => closed