shithub: libvpx

Download patch

ref: bd77931421a811a4d7469c8bd6f4e932b8f054a9
parent: 74dc64056535c317aff8b8f5e328922fc790eaa8
author: James Zern <jzern@google.com>
date: Thu Jun 29 10:42:03 EDT 2017

dct_partial_test,fwd_txfm: change << to *

left shift of a negative number is undefined in C; quiets a ubsan
warning

Change-Id: Ib1624ad5326ac8e0eead9348468ef7fe5d4df9a4

--- a/test/dct_partial_test.cc
+++ b/test/dct_partial_test.cc
@@ -46,7 +46,7 @@
   }
 
   switch (size) {
-    case 4: sum <<= 1; break;
+    case 4: sum *= 2; break;
     case 8: /*sum = sum;*/ break;
     case 16: sum >>= 1; break;
     case 32: sum >>= 3; break;
--- a/vpx_dsp/fwd_txfm.c
+++ b/vpx_dsp/fwd_txfm.c
@@ -84,7 +84,7 @@
   for (r = 0; r < 4; ++r)
     for (c = 0; c < 4; ++c) sum += input[r * stride + c];
 
-  output[0] = sum << 1;
+  output[0] = sum * 2;
 }
 
 void vpx_fdct8x8_c(const int16_t *input, tran_low_t *final_output, int stride) {