Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/tiff/, media-libs/tiff/files/
Date: Wed, 12 Apr 2017 19:30:33
Message-Id: 1492025137.f383efc4136c911abc8542073a34f2cc6038ee3a.vapier@gentoo
1 commit: f383efc4136c911abc8542073a34f2cc6038ee3a
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 12 19:13:34 2017 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 12 19:25:37 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f383efc4
7
8 media-libs/tiff: update pdfium patches to be more portable
9
10 Put helper funcs in the private headers, and stick to older C standards.
11
12 ...ferOverflow-ChopUpSingleUncompressedStrip.patch | 23 +++++++++++-----------
13 ...-4.0.7-pdfium-0013-validate-refblackwhite.patch | 5 +++--
14 .../{tiff-4.0.7-r2.ebuild => tiff-4.0.7-r3.ebuild} | 0
15 3 files changed, 14 insertions(+), 14 deletions(-)
16
17 diff --git a/media-libs/tiff/files/tiff-4.0.7-pdfium-0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch b/media-libs/tiff/files/tiff-4.0.7-pdfium-0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
18 index f573fd9deb3..a45ee342f77 100644
19 --- a/media-libs/tiff/files/tiff-4.0.7-pdfium-0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
20 +++ b/media-libs/tiff/files/tiff-4.0.7-pdfium-0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
21 @@ -19,16 +19,15 @@ overflow.
22 cp = _TIFFrealloc(buffer, bytes);
23
24 if (cp == NULL) {
25 ---- a/libtiff/tiffio.h
26 -+++ b/libtiff/tiffio.h
27 -@@ -298,6 +298,10 @@ extern void _TIFFmemset(void* p, int v, tmsize_t c);
28 - extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
29 - extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);
30 - extern void _TIFFfree(void* p);
31 -+#include <limits.h>
32 -+static inline int _TIFFIfMultiplicationOverflow(tmsize_t op1, tmsize_t op2) {
33 -+ return op1 > SSIZE_MAX / op2;
34 -+}
35 +--- a/libtiff/tiffiop.h
36 ++++ b/libtiff/tiffiop.h
37 +@@ -315,6 +315,9 @@ typedef size_t TIFFIOSize_t;
38 + #define _TIFF_off_t off_t
39 + #endif
40
41 - /*
42 - ** Stuff, related to tag handling and creating custom tags.
43 ++#include <limits.h>
44 ++#define _TIFFIfMultiplicationOverflow(op1, op2) ((op1) > SSIZE_MAX / (op2))
45 ++
46 + #if defined(__cplusplus)
47 + extern "C" {
48 + #endif
49
50 diff --git a/media-libs/tiff/files/tiff-4.0.7-pdfium-0013-validate-refblackwhite.patch b/media-libs/tiff/files/tiff-4.0.7-pdfium-0013-validate-refblackwhite.patch
51 index 47a3db06431..d98ff9d0f25 100644
52 --- a/media-libs/tiff/files/tiff-4.0.7-pdfium-0013-validate-refblackwhite.patch
53 +++ b/media-libs/tiff/files/tiff-4.0.7-pdfium-0013-validate-refblackwhite.patch
54 @@ -24,11 +24,12 @@ them to the default provided by the TIFF spec v6.
55 #include <float.h>
56
57 /*
58 -@@ -426,6 +426,14 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
59 +@@ -426,6 +426,15 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
60 case TIFFTAG_REFERENCEBLACKWHITE:
61 /* XXX should check for null range */
62 _TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 6);
63 -+ for (int i = 0; i < 6; i++) {
64 ++ int i;
65 ++ for (i = 0; i < 6; i++) {
66 + if (isnan(td->td_refblackwhite[i])) {
67 + if (i % 2 == 0)
68 + td->td_refblackwhite[i] = 0;
69
70 diff --git a/media-libs/tiff/tiff-4.0.7-r2.ebuild b/media-libs/tiff/tiff-4.0.7-r3.ebuild
71 similarity index 100%
72 rename from media-libs/tiff/tiff-4.0.7-r2.ebuild
73 rename to media-libs/tiff/tiff-4.0.7-r3.ebuild