SHA256
1
0
forked from pool/texlive

Accepting request 601703 from home:StefanBruens:branches:Publishing:TeXLive

- Add patch source-dvipdfm-x.dif to fix XeTeX bug #151

OBS-URL: https://build.opensuse.org/request/show/601703
OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive?expand=0&rev=288
This commit is contained in:
Dr. Werner Fink 2018-04-27 14:21:38 +00:00 committed by Git OBS Bridge
parent fd5300b6cd
commit bc5b4dde19
3 changed files with 37 additions and 0 deletions

29
source-dvipdfm-x.dif Normal file
View File

@ -0,0 +1,29 @@
--- texk/dvipdfm-x/pngimage.c_orig 2018-04-27 02:37:38.954103428 +0200
+++ texk/dvipdfm-x/pngimage.c 2018-04-27 02:48:48.121731743 +0200
@@ -966,12 +966,16 @@
png_bytep trans;
int num_trans;
png_uint_32 i;
+ png_byte bpc, mask, shift;
if (!png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ||
!png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL)) {
WARN("%s: PNG does not have valid tRNS chunk but tRNS is requested.", PNG_DEBUG_STR);
return NULL;
}
+ bpc = png_get_bit_depth(png_ptr, info_ptr);
+ mask = 0xff >> (8 - bpc);
+ shift = 8 - bpc;
smask = pdf_new_stream(STREAM_COMPRESS);
dict = pdf_stream_dict(smask);
@@ -983,7 +987,8 @@
pdf_add_dict(dict, pdf_new_name("ColorSpace"), pdf_new_name("DeviceGray"));
pdf_add_dict(dict, pdf_new_name("BitsPerComponent"), pdf_new_number(8));
for (i = 0; i < width*height; i++) {
- png_byte idx = image_data_ptr[i];
+ /* data is packed for 1/2/4 bpc formats, msb first */
+ png_byte idx = (image_data_ptr[bpc * i / 8] >> (shift - bpc * i % 8)) & mask;
smask_data_ptr[i] = (idx < num_trans) ? trans[idx] : 0xff;
}
pdf_add_stream(smask, (char *)smask_data_ptr, width*height);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Apr 27 00:54:31 UTC 2018 - stefan.bruens@rwth-aachen.de
- Add patch source-dvipdfm-x.dif to fix XeTeX bug #151
-------------------------------------------------------------------
Thu Apr 19 09:05:23 UTC 2018 - werner@suse.de

View File

@ -269,6 +269,8 @@ Patch47: biber-perl-5.18.2.dif
Patch48: http://www.linuxfromscratch.org/patches/blfs/svn/texlive-20170524-source-poppler059-1.patch
# PATCH-FIX-UPSTREAM source-poppler-0.59.1.dif -- Adapt to poppler 0.59.1+ API changes
Patch49: source-poppler-0.59.1.dif
# PATCH-FIX-SUSE https://sourceforge.net/p/xetex/bugs/151/ -- Fix OOB access when generating alpha mask for 1/2/4-bit indexed PNGs
Patch50: source-dvipdfm-x.dif
Prefix: %{_bindir}
Provides: pdfjam = %{version}
Obsoletes: pdfjam < %{version}
@ -3438,6 +3440,7 @@ if pkg-config --atleast-version=0.59 poppler; then
%patch48 -p1 -b .poppler59
%patch49 -p0 -b .poppler591
fi
%patch50 -p0 -b .dvipdfm-x
# Correct FHS paths
paths=$(find -name cnf-to-paths.awk)