aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-06 18:08:05 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-06 18:08:05 +0000
commit665b2cca88e25b821a69c9ce8a4fd7f551532012 (patch)
tree4b1f840ed9db09b30ee5aa0539d1bc46a24b232c /include/core
parent1335264fce00389c7d82105a52626ea2f48d277a (diff)
lockPixels before calling getColorTable.
Fixes a bug where we try to dereference a NULL pointer. Update the comment for SkBitmap::getColorTable, telling the client that pixels must be locked for it to return non-NULL. R=edisonn@google.com Review URL: https://codereview.chromium.org/15002002 git-svn-id: http://skia.googlecode.com/svn/trunk@9018 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkBitmap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 124525e249..ad18547980 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -371,7 +371,9 @@ public:
*/
SkGpuTexture* getTexture() const;
- /** Return the bitmap's colortable (if any). Does not affect the colortable's
+ /** Return the bitmap's colortable, if it uses one (i.e. fConfig is
+ kIndex8_Config or kRLE_Index8_Config) and the pixels are locked.
+ Otherwise returns NULL. Does not affect the colortable's
reference count.
*/
SkColorTable* getColorTable() const { return fColorTable; }