]> granicus.if.org Git - libvpx/commitdiff
sanitizer: fix unaligned loads
authorMatthias Räncker <theonetruecamper@gmx.de>
Fri, 21 Sep 2018 00:16:31 +0000 (02:16 +0200)
committerMatthias Räncker <theonetruecamper@gmx.de>
Fri, 21 Sep 2018 00:36:43 +0000 (02:36 +0200)
Another instance of unaligned 4-byte loads.

Signed-off-by: Matthias Räncker <theonetruecamper@gmx.de>
Change-Id: I06afc5405bb074384eec7a8c8123e5803e522937

vpx_dsp/x86/avg_pred_sse2.c

index f83b26490e7b7909b0013367524fec6ca2334c3b..e7db75559aca3c09bf15af72341290b0e2959ce7 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "./vpx_dsp_rtcd.h"
 #include "vpx/vpx_integer.h"
+#include "vpx_dsp/x86/mem_sse2.h"
 
 void vpx_comp_avg_pred_sse2(uint8_t *comp, const uint8_t *pred, int width,
                             int height, const uint8_t *ref, int ref_stride) {
@@ -45,10 +46,9 @@ void vpx_comp_avg_pred_sse2(uint8_t *comp, const uint8_t *pred, int width,
         r = _mm_loadu_si128((const __m128i *)ref);
         ref += 16;
       } else if (width == 4) {
-        r = _mm_set_epi32(*(const uint32_t *)(ref + 3 * ref_stride),
-                          *(const uint32_t *)(ref + 2 * ref_stride),
-                          *(const uint32_t *)(ref + ref_stride),
-                          *(const uint32_t *)(ref));
+        r = _mm_set_epi32(loadu_uint32(ref + 3 * ref_stride),
+                          loadu_uint32(ref + 2 * ref_stride),
+                          loadu_uint32(ref + ref_stride), loadu_uint32(ref));
 
         ref += 4 * ref_stride;
       } else {