diff options
author | fbarchard@google.com <fbarchard@google.com> | 2015-03-10 22:30:47 +0000 |
---|---|---|
committer | fbarchard@google.com <fbarchard@google.com> | 2015-03-10 22:30:47 +0000 |
commit | 1e4a14f41028fa7e0fd5d64af24f6957e534a972 (patch) | |
tree | 24574cdbe1403da1ccd49cba1b7a18b2a3acb656 /source/scale_argb.cc | |
parent | be77e062da042c1ec721e0a557d235893a2a4204 (diff) | |
download | libyuv-1e4a14f41028fa7e0fd5d64af24f6957e534a972.tar.gz |
scale avoid math overflow in fixed point for large images
BUG=410
TESTED=set LIBYUV_WIDTH=65536 out\release\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=libyuvTest.ScaleTo320x240_None
R=harryjin@google.com
Review URL: https://webrtc-codereview.appspot.com/42319004
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1320 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'source/scale_argb.cc')
-rw-r--r-- | source/scale_argb.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/scale_argb.cc b/source/scale_argb.cc index 05b58e1b..d69ecdc8 100644 --- a/source/scale_argb.cc +++ b/source/scale_argb.cc @@ -744,6 +744,7 @@ int ARGBScaleClip(const uint8* src_argb, int src_stride_argb, if (!src_argb || src_width == 0 || src_height == 0 || !dst_argb || dst_width <= 0 || dst_height <= 0 || clip_x < 0 || clip_y < 0 || + clip_width > 32768 || clip_height > 32768 || (clip_x + clip_width) > dst_width || (clip_y + clip_height) > dst_height) { return -1; @@ -762,6 +763,7 @@ int ARGBScale(const uint8* src_argb, int src_stride_argb, int dst_width, int dst_height, enum FilterMode filtering) { if (!src_argb || src_width == 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_argb || dst_width <= 0 || dst_height <= 0) { return -1; } |