summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 18:50:10 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-28 18:50:10 +0000
commitb5fdbb1566d570c0288f53f36c5a9bd84831c02d (patch)
treeaf7f7530cd12ff52f850cc103ded7c959bcbeee7 /o3d
parent3aaab9917e8d5386e817973185ca165823f3b46b (diff)
downloadchromium_src-b5fdbb1566d570c0288f53f36c5a9bd84831c02d.zip
chromium_src-b5fdbb1566d570c0288f53f36c5a9bd84831c02d.tar.gz
chromium_src-b5fdbb1566d570c0288f53f36c5a9bd84831c02d.tar.bz2
In some circumstances the O3D plugin is briefly resized to zero height,
causing the Core Graphics rendering backend to request a zero-height render target. base::bits::Log2Ceiling returns -1 for a zero input which was being translated to a huge unsigned integer value, leading to an assertion failure. Verified with submitter's use case. BUG=none TEST=none Review URL: http://codereview.chromium.org/2377002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/core/cross/image_utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/o3d/core/cross/image_utils.h b/o3d/core/cross/image_utils.h
index c9ee2d4..28e8b34 100644
--- a/o3d/core/cross/image_utils.h
+++ b/o3d/core/cross/image_utils.h
@@ -79,7 +79,7 @@ inline unsigned int ComputeMipMapCount(
// Gets the smallest power-of-two value that is at least as high as
// dimension. This is the POT dimension used in ScaleUpToPOT.
inline unsigned int ComputePOTSize(unsigned int dimension) {
- return 1 << base::bits::Log2Ceiling(dimension);
+ return (dimension == 0) ? 0 : 1 << base::bits::Log2Ceiling(dimension);
}
// Computes one dimension of a mip.