Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: source/row_gcc.cc

Issue 1657533005: ubsan overflow fix for multiply by 0x01010101 (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // VERSION 2 1 // VERSION 2
2 /* 2 /*
3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license 5 * Use of this source code is governed by a BSD-style license
6 * that can be found in the LICENSE file in the root of the source 6 * that can be found in the LICENSE file in the root of the source
7 * tree. An additional intellectual property rights grant can be found 7 * tree. An additional intellectual property rights grant can be found
8 * in the file PATENTS. All contributing project authors may 8 * in the file PATENTS. All contributing project authors may
9 * be found in the AUTHORS file in the root of the source tree. 9 * be found in the AUTHORS file in the root of the source tree.
10 */ 10 */
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 : 2893 :
2894 : "memory", "cc" 2894 : "memory", "cc"
2895 , "xmm0", "xmm1", "xmm2" 2895 , "xmm0", "xmm1", "xmm2"
2896 ); 2896 );
2897 } 2897 }
2898 #endif // HAS_ARGBCOPYYTOALPHAROW_AVX2 2898 #endif // HAS_ARGBCOPYYTOALPHAROW_AVX2
2899 2899
2900 #ifdef HAS_SETROW_X86 2900 #ifdef HAS_SETROW_X86
2901 void SetRow_X86(uint8* dst, uint8 v8, int width) { 2901 void SetRow_X86(uint8* dst, uint8 v8, int width) {
2902 size_t width_tmp = (size_t)(width >> 2); 2902 size_t width_tmp = (size_t)(width >> 2);
2903 const uint32 v32 = v8 * 0x01010101; // Duplicate byte to all bytes. 2903 const uint32 v32 = v8 * 0x01010101u; // Duplicate byte to all bytes.
2904 asm volatile ( 2904 asm volatile (
2905 "rep stosl " MEMSTORESTRING(eax,0) " \n" 2905 "rep stosl " MEMSTORESTRING(eax,0) " \n"
2906 : "+D"(dst), // %0 2906 : "+D"(dst), // %0
2907 "+c"(width_tmp) // %1 2907 "+c"(width_tmp) // %1
2908 : "a"(v32) // %2 2908 : "a"(v32) // %2
2909 : "memory", "cc"); 2909 : "memory", "cc");
2910 } 2910 }
2911 2911
2912 void SetRow_ERMS(uint8* dst, uint8 v8, int width) { 2912 void SetRow_ERMS(uint8* dst, uint8 v8, int width) {
2913 size_t width_tmp = (size_t)(width); 2913 size_t width_tmp = (size_t)(width);
(...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 ); 5390 );
5391 } 5391 }
5392 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 5392 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3
5393 5393
5394 #endif // defined(__x86_64__) || defined(__i386__) 5394 #endif // defined(__x86_64__) || defined(__i386__)
5395 5395
5396 #ifdef __cplusplus 5396 #ifdef __cplusplus
5397 } // extern "C" 5397 } // extern "C"
5398 } // namespace libyuv 5398 } // namespace libyuv
5399 #endif 5399 #endif
OLDNEW
« no previous file with comments | « include/libyuv/version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698