summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2017-04-12 15:13:34 -0400
committerMike Frysinger <vapier@gentoo.org>2017-04-12 15:25:37 -0400
commitf383efc4136c911abc8542073a34f2cc6038ee3a (patch)
treee0289f3fef5ce03438476de2bbe85966ecd80179 /media-libs/tiff/files
parentdev-ml/ocaml-conduit: Fix build with lwt3. (diff)
downloadgentoo-f383efc4136c911abc8542073a34f2cc6038ee3a.tar.gz
gentoo-f383efc4136c911abc8542073a34f2cc6038ee3a.tar.bz2
gentoo-f383efc4136c911abc8542073a34f2cc6038ee3a.zip
media-libs/tiff: update pdfium patches to be more portable
Put helper funcs in the private headers, and stick to older C standards.
Diffstat (limited to 'media-libs/tiff/files')
-rw-r--r--media-libs/tiff/files/tiff-4.0.7-pdfium-0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch23
-rw-r--r--media-libs/tiff/files/tiff-4.0.7-pdfium-0013-validate-refblackwhite.patch5
2 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 f573fd9deb33..a45ee342f779 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 47a3db06431a..d98ff9d0f252 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;