shithub: libvpx

Download patch

ref: 512b67f0239dc31cbf7b0b5b68227924b1728bde
parent: 5e679848e8e58df21f6c6448f9c2d468c31949d1
parent: f26fccf3b294d538ddcfde00a35e0de2080c1cee
author: James Zern <[email protected]>
date: Thu May 5 22:26:37 EDT 2016

Merge "md5_utils,MD5Transform: don't check for unsigned overflow"

--- a/md5_utils.c
+++ b/md5_utils.c
@@ -150,12 +150,23 @@
 #define MD5STEP(f,w,x,y,z,in,s) \
   (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
 
+#if defined(__clang__) && defined(__has_attribute)
+#if __has_attribute(no_sanitize)
+#define VPX_NO_UNSIGNED_OVERFLOW_CHECK \
+  __attribute__((no_sanitize("unsigned-integer-overflow")))
+#endif
+#endif
+
+#ifndef VPX_NO_UNSIGNED_OVERFLOW_CHECK
+#define VPX_NO_UNSIGNED_OVERFLOW_CHECK
+#endif
+
 /*
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
  * reflect the addition of 16 longwords of new data.  MD5Update blocks
  * the data and converts bytes into longwords for this routine.
  */
-void
+VPX_NO_UNSIGNED_OVERFLOW_CHECK void
 MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) {
   register UWORD32 a, b, c, d;
 
@@ -237,5 +248,7 @@
   buf[2] += c;
   buf[3] += d;
 }
+
+#undef VPX_NO_UNSIGNED_OVERFLOW_CHECK
 
 #endif