diff options
author | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-13 18:29:51 +0000 |
---|---|---|
committer | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-13 18:29:51 +0000 |
commit | 4428734907480cdb4ccecb47152d7be8cd1aec32 (patch) | |
tree | 520bff41ac842edf673efa42d59115366363c544 /src | |
parent | 0daa1adb03b4b1fc11d854cb7754416ac05a31e8 (diff) |
Allow 0-width SkBitmap in setConfig.
Previously, SkBitmap::setConfig would allow zero height, but not zero
width. This is changed for consistancy.
A unit test was added.
BUG=
R=reed@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/111953004
git-svn-id: http://skia.googlecode.com/svn/trunk@12673 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 25a6b1dba4..f2b56290ea 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -298,7 +298,7 @@ bool SkBitmap::setConfig(Config config, int width, int height, size_t rowBytes, } if (rowBytes == 0) { rowBytes = SkBitmap::ComputeRowBytes(config, width); - if (0 == rowBytes && kNo_Config != config) { + if (0 == rowBytes && kNo_Config != config && width > 0) { goto BAD_CONFIG; } } |