Fixed bad memory access

BUG=323595
R=senorblanco@google.com, reed@google.com, sugoi@google.com, senorblanco@chromium.org

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/88643004

git-svn-id: http://skia.googlecode.com/svn/trunk@12410 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-11-26 23:52:20 +00:00
parent 1eeeaabfdc
commit 72ca2654ef

View File

@ -203,7 +203,7 @@ bool SkValidatingReadBuffer::readScalarArray(SkScalar* values, size_t size) {
uint32_t SkValidatingReadBuffer::getArrayCount() { uint32_t SkValidatingReadBuffer::getArrayCount() {
const size_t inc = sizeof(uint32_t); const size_t inc = sizeof(uint32_t);
fError = fError || !IsPtrAlign4(fReader.peek()) || !fReader.isAvailable(inc); fError = fError || !IsPtrAlign4(fReader.peek()) || !fReader.isAvailable(inc);
return *(uint32_t*)fReader.peek(); return fError ? 0 : *(uint32_t*)fReader.peek();
} }
void SkValidatingReadBuffer::readBitmap(SkBitmap* bitmap) { void SkValidatingReadBuffer::readBitmap(SkBitmap* bitmap) {