commit:     f383efc4136c911abc8542073a34f2cc6038ee3a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 12 19:13:34 2017 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 19:25:37 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f383efc4

media-libs/tiff: update pdfium patches to be more portable

Put helper funcs in the private headers, and stick to older C standards.

 ...ferOverflow-ChopUpSingleUncompressedStrip.patch | 23 +++++++++++-----------
 ...-4.0.7-pdfium-0013-validate-refblackwhite.patch |  5 +++--
 .../{tiff-4.0.7-r2.ebuild => tiff-4.0.7-r3.ebuild} |  0
 3 files changed, 14 insertions(+), 14 deletions(-)

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
index f573fd9deb3..a45ee342f77 100644
--- 
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
@@ -19,16 +19,15 @@ overflow.
                cp = _TIFFrealloc(buffer, bytes);
  
        if (cp == NULL) {
---- a/libtiff/tiffio.h
-+++ b/libtiff/tiffio.h
-@@ -298,6 +298,10 @@ extern void _TIFFmemset(void* p, int v, tmsize_t c);
- extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
- extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);
- extern void _TIFFfree(void* p);
-+#include <limits.h>
-+static inline int _TIFFIfMultiplicationOverflow(tmsize_t op1, tmsize_t op2) {
-+  return op1 > SSIZE_MAX / op2;
-+}
+--- a/libtiff/tiffiop.h
++++ b/libtiff/tiffiop.h
+@@ -315,6 +315,9 @@ typedef size_t TIFFIOSize_t;
+ #define _TIFF_off_t off_t
+ #endif
  
- /*
- ** Stuff, related to tag handling and creating custom tags.
++#include <limits.h>
++#define _TIFFIfMultiplicationOverflow(op1, op2) ((op1) > SSIZE_MAX / (op2))
++
+ #if defined(__cplusplus)
+ extern "C" {
+ #endif

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
index 47a3db06431..d98ff9d0f25 100644
--- 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
@@ -24,11 +24,12 @@ them to the default provided by the TIFF spec v6.
  #include <float.h>
  
  /*
-@@ -426,6 +426,14 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
+@@ -426,6 +426,15 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
        case TIFFTAG_REFERENCEBLACKWHITE:
                /* XXX should check for null range */
                _TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 
6);
-+              for (int i = 0; i < 6; i++) {
++              int i;
++              for (i = 0; i < 6; i++) {
 +                      if (isnan(td->td_refblackwhite[i])) {
 +                              if (i % 2 == 0)
 +                                      td->td_refblackwhite[i] = 0;

diff --git a/media-libs/tiff/tiff-4.0.7-r2.ebuild 
b/media-libs/tiff/tiff-4.0.7-r3.ebuild
similarity index 100%
rename from media-libs/tiff/tiff-4.0.7-r2.ebuild
rename to media-libs/tiff/tiff-4.0.7-r3.ebuild

Reply via email to