Commit ac9b96c0 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent 90a36b29
......@@ -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);
......
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