Permalink
Browse files

Null check to fix crash

Need to make sure that img is not zero.

bug: 6864545
Change-Id: I2a2c5440347681b462abaa5ac9101ddb6137c8c4
  • Loading branch information...
1 parent 8ac8b3f commit 0e8bb60087a019d104b6eb4aa8abd11bd91b16c4 Bart Sears committed Jul 23, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 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;
}

0 comments on commit 0e8bb60

Please sign in to comment.