Commit 1e4a14f4 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent be77e062
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1318
Version: 1320
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1318
#define LIBYUV_VERSION 1320
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -1565,6 +1565,7 @@ int I420Scale(const uint8* src_y, int src_stride_y,
int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1);
int dst_halfheight = SUBSAMPLE(dst_height, 1, 1);
if (!src_y || !src_u || !src_v || src_width == 0 || src_height == 0 ||
src_width > 32768 || src_height > 32768 ||
!dst_y || !dst_u || !dst_v || dst_width <= 0 || dst_height <= 0) {
return -1;
}
......@@ -1596,6 +1597,7 @@ int I420Scale_16(const uint16* src_y, int src_stride_y,
int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1);
int dst_halfheight = SUBSAMPLE(dst_height, 1, 1);
if (!src_y || !src_u || !src_v || src_width == 0 || src_height == 0 ||
src_width > 32768 || src_height > 32768 ||
!dst_y || !dst_u || !dst_v || dst_width <= 0 || dst_height <= 0) {
return -1;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment