0067d1
diff -up texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc.poppler-0.73 texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc
0067d1
--- texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc.poppler-0.73	2019-05-23 15:50:17.849768543 -0400
0067d1
+++ texlive-base-20190410/source/texk/web2c/pdftexdir/pdftoepdf.cc	2019-05-23 16:00:41.022262790 -0400
0067d1
@@ -120,7 +120,7 @@ struct UsedEncoding {
0067d1
 
0067d1
 static InObj *inObjList;
0067d1
 static UsedEncoding *encodingList;
0067d1
-static GBool isInit = gFalse;
0067d1
+static bool isInit = false;
0067d1
 
0067d1
 // --------------------------------------------------------------------
0067d1
 // Maintain list of open embedded PDF files
0067d1
@@ -275,7 +275,7 @@ static int getNewObjectNumber(Ref ref)
0067d1
 
0067d1
 static void copyObject(Object *);
0067d1
 
0067d1
-static void copyName(char *s)
0067d1
+static void copyName(const char *s)
0067d1
 {
0067d1
     pdf_puts("/");
0067d1
     for (; *s != 0; s++) {
0067d1
@@ -310,7 +310,7 @@ static void copyDict(Object * obj)
0067d1
 static void copyFontDict(Object * obj, InObj * r)
0067d1
 {
0067d1
     int i, l;
0067d1
-    char *key;
0067d1
+    const char *key;
0067d1
     if (!obj->isDict())
0067d1
         pdftex_fail("PDF inclusion: invalid dict type <%s>",
0067d1
                     obj->getTypeName());
0067d1
@@ -382,7 +382,7 @@ static bool embeddableFont(Object * font
0067d1
     return false;
0067d1
 }
0067d1
 
0067d1
-static void copyFont(char *tag, Object * fontRef)
0067d1
+static void copyFont(const char *tag, Object * fontRef)
0067d1
 {
0067d1
     Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
0067d1
         stemV;
0067d1
@@ -418,7 +418,7 @@ static void copyFont(char *tag, Object *
0067d1
         && fontdescRef.isRef()
0067d1
         && fontdesc.isDict()
0067d1
         && embeddableFont(&fontdesc)
0067d1
-        && (fontmap = lookup_fontmap(basefont.getName())) != NULL) {
0067d1
+        && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) {
0067d1
         // round /StemV value, since the PDF input is a float
0067d1
         // (see Font Descriptors in PDF reference), but we only store an
0067d1
         // integer, since we don't want to change the struct.
0067d1
@@ -427,7 +427,7 @@ static void copyFont(char *tag, Object *
0067d1
         charset = fontdesc.dictLookup("CharSet");
0067d1
         if (!charset.isNull() &&
0067d1
             charset.isString() && is_subsetable(fontmap))
0067d1
-            epdf_mark_glyphs(fd, charset.getString()->getCString());
0067d1
+            epdf_mark_glyphs(fd, (char *)charset.getString()->c_str());
0067d1
         else
0067d1
             embed_whole_font(fd);
0067d1
         addFontDesc(fontdescRef.getRef(), fd);
0067d1
@@ -467,7 +467,7 @@ static void copyFontResources(Object * o
0067d1
     pdf_puts(">>\n");
0067d1
 }
0067d1
 
0067d1
-static void copyOtherResources(Object * obj, char *key)
0067d1
+static void copyOtherResources(Object * obj, const char *key)
0067d1
 {
0067d1
     // copies all other resources (write_epdf handles Fonts and ProcSets),
0067d1
 
0067d1
@@ -554,8 +554,8 @@ static void copyObject(Object * obj)
0067d1
     Object obj1;
0067d1
     int i, l, c;
0067d1
     Ref ref;
0067d1
-    char *p;
0067d1
-    GString *s;
0067d1
+    const char *p;
0067d1
+    const GString *s;
0067d1
     if (obj->isBool()) {
0067d1
         pdf_printf("%s", obj->getBool()? "true" : "false");
0067d1
     } else if (obj->isInt()) {
0067d1
@@ -566,7 +566,7 @@ static void copyObject(Object * obj)
0067d1
         pdf_printf("%s", convertNumToPDF(obj->getNum()));
0067d1
     } else if (obj->isString()) {
0067d1
         s = obj->getString();
0067d1
-        p = s->getCString();
0067d1
+        p = s->c_str();
0067d1
         l = s->getLength();
0067d1
         if (strlen(p) == (unsigned int) l) {
0067d1
             pdf_puts("(");
0067d1
@@ -664,7 +664,7 @@ static void writeEncodings()
0067d1
                     ("PDF inclusion: CID fonts are not supported"
0067d1
                      " (try to disable font replacement to fix this)");
0067d1
             }
0067d1
-            if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
0067d1
+            if ((s = (char *) ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
0067d1
                 glyphNames[i] = s;
0067d1
             else
0067d1
                 glyphNames[i] = notdef;
0067d1
@@ -683,7 +683,7 @@ static void writeEncodings()
0067d1
 }
0067d1
 
0067d1
 // get the pagebox according to the pagebox_spec
0067d1
-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
0067d1
+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
0067d1
 {
0067d1
     if (pagebox_spec == pdfboxspecmedia)
0067d1
         return page->getMediaBox();
0067d1
@@ -715,7 +715,7 @@ read_pdf_info(char *image_name, char *pa
0067d1
 {
0067d1
     PdfDocument *pdf_doc;
0067d1
     Page *page;
0067d1
-    PDFRectangle *pagebox;
0067d1
+    const PDFRectangle *pagebox;
0067d1
 #ifdef POPPLER_VERSION
0067d1
     int pdf_major_version_found, pdf_minor_version_found;
0067d1
 #else
0067d1
@@ -724,8 +724,8 @@ read_pdf_info(char *image_name, char *pa
0067d1
     // initialize
0067d1
     if (!isInit) {
0067d1
         globalParams = new GlobalParams();
0067d1
-        globalParams->setErrQuiet(gFalse);
0067d1
-        isInit = gTrue;
0067d1
+        globalParams->setErrQuiet(false);
0067d1
+        isInit = true;
0067d1
     }
0067d1
     // open PDF file
0067d1
     pdf_doc = find_add_document(image_name);
0067d1
@@ -822,7 +822,7 @@ void write_epdf(void)
0067d1
     Object groupDict;
0067d1
     bool writeSepGroup = false;
0067d1
     Object info;
0067d1
-    char *key;
0067d1
+    const char *key;
0067d1
     char s[256];
0067d1
     int i, l;
0067d1
     int rotate;
0067d1
@@ -849,7 +849,7 @@ void write_epdf(void)
0067d1
     pageObj = xref->fetch(pageRef->num, pageRef->gen);
0067d1
     pageDict = pageObj.getDict();
0067d1
     rotate = page->getRotate();
0067d1
-    PDFRectangle *pagebox;
0067d1
+    const PDFRectangle *pagebox;
0067d1
     // write the Page header
0067d1
     pdf_puts("/Type /XObject\n");
0067d1
     pdf_puts("/Subtype /Form\n");
0067d1
@@ -977,7 +977,7 @@ The changes below seem to work fine.
0067d1
             }
0067d1
             l = dic1.getLength();
0067d1
             for (i = 0; i < l; i++) {
0067d1
-                groupDict.dictAdd(copyString(dic1.getKey(i)),
0067d1
+                groupDict.dictAdd(dic1.getKey(i),
0067d1
                                   dic1.getValNF(i));
0067d1
             }
0067d1
 // end modification
0067d1
diff -up texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc.poppler-0.73 texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc
0067d1
--- texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc.poppler-0.73	2019-05-23 15:50:17.850768522 -0400
0067d1
+++ texlive-base-20190410/source/texk/web2c/pdftexdir/pdftosrc.cc	2019-05-23 15:50:17.858768349 -0400
0067d1
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
0067d1
             fprintf(stderr, "No SourceName found\n");
0067d1
             exit(1);
0067d1
         }
0067d1
-        outname = srcName.getString()->getCString();
0067d1
+        outname = (char *)srcName.getString()->c_str();
0067d1
         // We cannot free srcName, as objname shares its string.
0067d1
         // srcName.free();
0067d1
     } else if (objnum > 0) {
0067d1
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
0067d1
             fprintf(stderr, "Not a Stream object\n");
0067d1
             exit(1);
0067d1
         }
0067d1
-        sprintf(buf, "%s", fileName->getCString());
0067d1
+        sprintf(buf, "%s", fileName->c_str());
0067d1
         if ((p = strrchr(buf, '.')) == 0)
0067d1
             p = strchr(buf, 0);
0067d1
         if (objgen == 0)
0067d1
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
0067d1
         outname = buf;
0067d1
     } else {                    // objnum < 0 means we are extracting the XRef table
0067d1
         extract_xref_table = true;
0067d1
-        sprintf(buf, "%s", fileName->getCString());
0067d1
+        sprintf(buf, "%s", fileName->c_str());
0067d1
         if ((p = strrchr(buf, '.')) == 0)
0067d1
             p = strchr(buf, 0);
0067d1
         sprintf(p, ".xref");
0067d1
@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
0067d1
                 Object objStr, obj1, obj2;
0067d1
                 int nObjects, first, n;
0067d1
                 int localOffset = 0;
0067d1
-                Guint firstOffset;
0067d1
+                unsigned int firstOffset;
0067d1
 
0067d1
                 objStr = xref->fetch(e->offset, 0);
0067d1
                 assert(objStr.isStream());
0067d1
@@ -173,9 +173,9 @@ int main(int argc, char *argv[])
0067d1
 
0067d1
                 // parse the header: object numbers and offsets
0067d1
                 objStr.streamReset();
0067d1
-                str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first);
0067d1
+                str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);
0067d1
                 lexer = new Lexer(xref, str);
0067d1
-                parser = new Parser(xref, lexer, gFalse);
0067d1
+                parser = new Parser(xref, lexer, false);
0067d1
                 for (n = 0; n < nObjects; ++n) {
0067d1
                     obj1 = parser->getObj();
0067d1
                     obj2 = parser->getObj();
0067d1
diff -up texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp.poppler-0.73 texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp
0067d1
--- texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp.poppler-0.73	2018-12-25 00:48:22.000000000 -0500
0067d1
+++ texlive-base-20190410/source/texk/web2c/xetexdir/pdfimage.cpp	2019-05-23 15:50:17.858768349 -0400
0067d1
@@ -78,26 +78,29 @@ pdf_get_rect(char* filename, int page_nu
0067d1
 
0067d1
 	Page*		page = doc->getCatalog()->getPage(page_num);
0067d1
 
0067d1
-	const PDFRectangle*	r;
0067d1
+	PDFRectangle*	r;
0067d1
+	const PDFRectangle*	cr;
0067d1
 	switch (pdf_box) {
0067d1
 		default:
0067d1
 		case pdfbox_crop:
0067d1
-			r = page->getCropBox();
0067d1
+			cr = page->getCropBox();
0067d1
 			break;
0067d1
 		case pdfbox_media:
0067d1
-			r = page->getMediaBox();
0067d1
+			cr = page->getMediaBox();
0067d1
 			break;
0067d1
 		case pdfbox_bleed:
0067d1
-			r = page->getBleedBox();
0067d1
+			cr = page->getBleedBox();
0067d1
 			break;
0067d1
 		case pdfbox_trim:
0067d1
-			r = page->getTrimBox();
0067d1
+			cr = page->getTrimBox();
0067d1
 			break;
0067d1
 		case pdfbox_art:
0067d1
-			r = page->getArtBox();
0067d1
+			cr = page->getArtBox();
0067d1
 			break;
0067d1
 	}
0067d1
 
0067d1
+	r = new PDFRectangle (cr->x1, cr->y1, cr->x2, cr->y2);
0067d1
+
0067d1
 	int RotAngle = 0;
0067d1
 	RotAngle = (int)page->getRotate() % 360;
0067d1
 	if (RotAngle < 0)
0067d1
@@ -112,6 +115,7 @@ pdf_get_rect(char* filename, int page_nu
0067d1
 	box->x  = 72.27 / 72 * my_fmin(r->x1, r->x2);
0067d1
 	box->y  = 72.27 / 72 * my_fmin(r->y1, r->y2);
0067d1
 
0067d1
+	delete r;
0067d1
 	delete doc;
0067d1
 
0067d1
 	return 0;