replace group handling code in pdftoepdf.cc with code that is simpler (and does not crash)

This commit is contained in:
Tom spot Callaway 2022-01-20 15:15:52 -05:00
parent 16fab6a59a
commit 6ab6f75880
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,34 @@
diff -up texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc.debug texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc
--- texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc.debug 2022-01-20 10:25:58.454233201 -0500
+++ texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc 2022-01-20 12:57:04.241513707 -0500
@@ -962,21 +962,30 @@ A change
does not improve the situation.
The changes below seem to work fine.
*/
+ if (page->getGroup() != NULL) {
+ groupDict = Object(page->getGroup());
+ } else {
+ pdftex_fail("PDF inclusion: getGroup failed");
+ }
+/*
// begin modification
groupDict = pageDict->lookup("Group");
Dict *dic1 = page->getGroup();
Dict *dic2 = groupDict.getDict();
// replace dic2 in groupDict with dic1
l = dic2->getLength();
+ pdftex_warn("dic2 length is %d", l);
for (i = 0; i < l; i++) {
groupDict.dictRemove(dic2->getKey(i));
}
l = dic1->getLength();
+ pdftex_warn("dic1 length is %d", l);
for (i = 0; i < l; i++) {
groupDict.dictAdd(dic1->getKey(i),
dic1->getValNF(i).copy());
}
// end modification
+*/
pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval);
}
}

View File

@ -20,7 +20,7 @@
Name: %{shortname}-base
Version: %{source_date}
Release: 46%{?dist}
Release: 47%{?dist}
Epoch: 9
Summary: TeX formatting system
# The only files in the base package are directories, cache, and license texts
@ -477,6 +477,8 @@ Patch33: texlive-base-20210325-no-setpdfwrite.patch
# Poppler 22
Patch34: texlive-base-20210325-poppler-22.01.0.patch
# Fix crash in handling Group
Patch35: texlive-base-20210325-pdftoepdf-fix-crash.patch
# Can't do this because it causes everything else to be noarch
# BuildArch: noarch
@ -6741,6 +6743,7 @@ xz -dc %{SOURCE0} | tar x
%if 0%{?fedora} >= 36
%patch34 -p1 -b .poppler22
%patch35 -p1 -b .poppler-crash-fix
%endif
# Setup copies of the licenses
@ -9404,6 +9407,9 @@ yes | %{_bindir}/updmap-sys --quiet --syncwithtrees >/dev/null 2>&1 || :
%doc %{_texdir}/texmf-dist/doc/latex/yplan/
%changelog
* Thu Jan 20 2022 Tom Callaway <spot@fedoraproject.org> - 9:20210325-47
- replace group handling code in pdftoepdf.cc with code that is simpler (and does not crash)
* Sat Jan 15 2022 Tom Callaway <spot@fedoraproject.org> - 9:20210325-46
- bootstrap off (conditionalize poppler changes)