Work around for 1 pixel destination

BUG=302
TEST=*1x1*
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/6519004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@943 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
fbarchard@google.com 2014-01-03 00:51:12 +00:00
parent 90a36b29d3
commit ac9b96c076

View File

@ -634,6 +634,13 @@ void ScaleSlope(int src_width, int src_height,
assert(src_height != 0);
assert(dst_width > 0);
assert(dst_height > 0);
// Check for 1 pixel and avoid FixedDiv overflow.
if (dst_width == 1) {
dst_width = src_width;
}
if (dst_height == 1) {
dst_height = src_height;
}
if (filtering == kFilterBox) {
// Scale step for point sampling duplicates all pixels equally.
*dx = FixedDiv(Abs(src_width), dst_width);