summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/qcms/google.patch
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/qcms/google.patch')
-rw-r--r--chromium/third_party/qcms/google.patch78
1 files changed, 72 insertions, 6 deletions
diff --git a/chromium/third_party/qcms/google.patch b/chromium/third_party/qcms/google.patch
index e98d91adf71..16353c054cd 100644
--- a/chromium/third_party/qcms/google.patch
+++ b/chromium/third_party/qcms/google.patch
@@ -1,5 +1,5 @@
diff --git a/third_party/qcms/src/iccread.c b/third_party/qcms/src/iccread.c
-index 36b7011..d3c3dfe 100644
+index 36b7011..9ee6b94 100644
--- a/third_party/qcms/src/iccread.c
+++ b/third_party/qcms/src/iccread.c
@@ -266,7 +266,7 @@ qcms_bool qcms_profile_is_bogus(qcms_profile *profile)
@@ -52,6 +52,16 @@ index 36b7011..d3c3dfe 100644
uint32_t clut_size;
size_t entry_size;
struct lutType *lut;
+@@ -997,6 +1006,9 @@ qcms_profile* qcms_profile_from_memory(const void *mem, size_t size)
+ source.size = size;
+ source.valid = true;
+
++ if (size < 4)
++ return INVALID_PROFILE;
++
+ length = read_u32(src, 0);
+ if (length <= size) {
+ // shrink the area that we can read if appropriate
diff --git a/third_party/qcms/src/qcms.h b/third_party/qcms/src/qcms.h
index 7d83623..11fe222 100644
--- a/third_party/qcms/src/qcms.h
@@ -91,7 +101,7 @@ index 7d83623..11fe222 100644
void qcms_enable_iccv4();
diff --git a/third_party/qcms/src/qcmsint.h b/third_party/qcms/src/qcmsint.h
-index 53a3420..af20948 100644
+index 53a3420..fb53e96 100644
--- a/third_party/qcms/src/qcmsint.h
+++ b/third_party/qcms/src/qcmsint.h
@@ -45,6 +45,11 @@ struct precache_output
@@ -150,10 +160,10 @@ index 53a3420..af20948 100644
+long __cdecl _InterlockedDecrement(long volatile *);
+#pragma intrinsic(_InterlockedIncrement)
+#pragma intrinsic(_InterlockedDecrement)
-+
++
+#define qcms_atomic_increment(x) _InterlockedIncrement((long volatile *)&x)
+#define qcms_atomic_decrement(x) _InterlockedDecrement((long volatile*)&x)
-+
++
+#else
+
+#define qcms_atomic_increment(x) __sync_add_and_fetch(&x, 1)
@@ -161,10 +171,57 @@ index 53a3420..af20948 100644
+
+#endif
diff --git a/third_party/qcms/src/qcmstypes.h b/third_party/qcms/src/qcmstypes.h
-index 56d8de3..9a9b197 100644
+index 56d8de3..d58f691 100644
--- a/third_party/qcms/src/qcmstypes.h
+++ b/third_party/qcms/src/qcmstypes.h
-@@ -87,7 +87,12 @@ typedef unsigned __int64 uint64_t;
+@@ -22,37 +22,6 @@
+ #ifndef QCMS_TYPES_H
+ #define QCMS_TYPES_H
+
+-#ifdef MOZ_QCMS
+-
+-#include "prtypes.h"
+-
+-/* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */
+-
+-#if defined (__SVR4) && defined (__sun)
+-/* int_types.h gets included somehow, so avoid redefining the types differently */
+-#include <sys/int_types.h>
+-#elif defined (_AIX)
+-#include <sys/types.h>
+-#elif !defined(ANDROID) && !defined(__OpenBSD__)
+-typedef PRInt8 int8_t;
+-typedef PRUint8 uint8_t;
+-typedef PRInt16 int16_t;
+-typedef PRUint16 uint16_t;
+-typedef PRInt32 int32_t;
+-typedef PRUint32 uint32_t;
+-typedef PRInt64 int64_t;
+-typedef PRUint64 uint64_t;
+-
+-#ifdef __OS2__
+-/* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
+-#include <stdlib.h>
+-#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
+-typedef PRUptrdiff uintptr_t;
+-#endif
+-#endif
+-
+-#else // MOZ_QCMS
+-
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ #define IS_LITTLE_ENDIAN
+ #elif BYTE_ORDER == BIG_ENDIAN
+@@ -75,7 +44,7 @@ typedef PRUptrdiff uintptr_t;
+
+ #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
+ # include <inttypes.h>
+-#elif defined (_MSC_VER)
++#elif defined (_MSC_VER) && _MSC_VER < 1600
+ typedef __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+ typedef __int16 int16_t;
+@@ -87,7 +56,12 @@ typedef unsigned __int64 uint64_t;
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
@@ -177,6 +234,15 @@ index 56d8de3..9a9b197 100644
#endif
#elif defined (_AIX)
+@@ -96,8 +70,6 @@ typedef unsigned long uintptr_t;
+ # include <stdint.h>
+ #endif
+
+-#endif
+-
+ typedef qcms_bool bool;
+ #define true 1
+ #define false 0
diff --git a/third_party/qcms/src/transform-sse1.c b/third_party/qcms/src/transform-sse1.c
index 2f34db5..aaee1bf 100644
--- a/third_party/qcms/src/transform-sse1.c