diff options
author | Bart Sears <bsears@google.com> | 2012-07-23 14:47:41 -0700 |
---|---|---|
committer | Bart Sears <bsears@google.com> | 2012-07-23 14:47:41 -0700 |
commit | 0e8bb60087a019d104b6eb4aa8abd11bd91b16c4 (patch) | |
tree | ed3b018afba04fe7d904209ec8abfdcd67d87f68 /Source | |
parent | 8ac8b3f2e5f239eb5068c9a5ac17dae28cceec8b (diff) | |
download | external_webkit-0e8bb60087a019d104b6eb4aa8abd11bd91b16c4.zip external_webkit-0e8bb60087a019d104b6eb4aa8abd11bd91b16c4.tar.gz external_webkit-0e8bb60087a019d104b6eb4aa8abd11bd91b16c4.tar.bz2 |
Null check to fix crash
Need to make sure that img is not zero.
bug: 6864545
Change-Id: I2a2c5440347681b462abaa5ac9101ddb6137c8c4
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp index c9c887a..aa84427 100644 --- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp @@ -131,7 +131,9 @@ unsigned ImageTexture::computeCRC(const SkBitmap* bitmap) return 0; bitmap->lockPixels(); uint8_t* img = static_cast<uint8_t*>(bitmap->getPixels()); - unsigned crc = computeCrc(img, bitmap->getSize()); + unsigned crc = 0; + if (img) + crc = computeCrc(img, bitmap->getSize()); bitmap->unlockPixels(); return crc; } |