aboutsummaryrefslogtreecommitdiff
path: root/source/convert_from.cc
diff options
context:
space:
mode:
authorfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2013-05-31 16:55:27 +0000
committerfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2013-05-31 16:55:27 +0000
commit37c0e648d20e9c1527b23d0edeef49a6d2988ab5 (patch)
treea0101fcba19320755efdbf7be988a9e646e8fb8a /source/convert_from.cc
parent314dbf71c32fd31b9a73258067564483b1f66d99 (diff)
downloadlibyuv-37c0e648d20e9c1527b23d0edeef49a6d2988ab5.tar.gz
Fix crash on wide images
BUG=239 TEST=LIBYUV_WIDTH=10000 out\release\libyuv_unittest R=changjun.yang@intel.com, johannkoenig@google.com Review URL: https://webrtc-codereview.appspot.com/1586006 git-svn-id: http://libyuv.googlecode.com/svn/trunk@712 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'source/convert_from.cc')
-rw-r--r--source/convert_from.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/convert_from.cc b/source/convert_from.cc
index 870a81c8..87f9b5cb 100644
--- a/source/convert_from.cc
+++ b/source/convert_from.cc
@@ -886,7 +886,7 @@ int I420ToARGB1555(const uint8* src_y, int src_stride_y,
uint8* rgb_buf,
int width) = I422ToARGB1555Row_C;
#if defined(HAS_I422TOARGB1555ROW_SSSE3)
- if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width <= kMaxStride * 4) {
+ if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 <= kMaxStride) {
I422ToARGB1555Row = I422ToARGB1555Row_Any_SSSE3;
if (IS_ALIGNED(width, 8)) {
I422ToARGB1555Row = I422ToARGB1555Row_SSSE3;
@@ -937,7 +937,7 @@ int I420ToARGB4444(const uint8* src_y, int src_stride_y,
uint8* rgb_buf,
int width) = I422ToARGB4444Row_C;
#if defined(HAS_I422TOARGB4444ROW_SSSE3)
- if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width <= kMaxStride * 4) {
+ if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width * 4 <= kMaxStride) {
I422ToARGB4444Row = I422ToARGB4444Row_Any_SSSE3;
if (IS_ALIGNED(width, 8)) {
I422ToARGB4444Row = I422ToARGB4444Row_SSSE3;
@@ -989,7 +989,7 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y,
#if defined(HAS_I422TORGB565ROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8
#if defined(__x86_64__) || defined(__i386__)
- && width <= kMaxStride * 4
+ && width * 4 <= kMaxStride
#endif
) {
I422ToRGB565Row = I422ToRGB565Row_Any_SSSE3;