}
void SkValidatingReadBuffer::readString(SkString* string) {
- const size_t len = this->readInt();
+ const size_t len = this->readUInt();
const void* ptr = fReader.peek();
const char* cptr = (const char*)ptr;
void SkValidatingReadBuffer::readBitmap(SkBitmap* bitmap) {
const int width = this->readInt();
const int height = this->readInt();
+ const bool useBitmapHeap = this->readBool();
const size_t length = this->readUInt();
// A size of zero means the SkBitmap was simply flattened.
- this->validate(length == 0);
- if (fError) {
+ if (!this->validate(!useBitmapHeap && (0 == length))) {
return;
}
bitmap->unflatten(*this);
SkFlattenable* obj = NULL;
uint32_t sizeRecorded = this->readUInt();
if (factory) {
- uint32_t offset = fReader.offset();
+ size_t offset = fReader.offset();
obj = (*factory)(*this);
// check that we read the amount we expected
- uint32_t sizeRead = fReader.offset() - offset;
+ size_t sizeRead = fReader.offset() - offset;
this->validate(sizeRecorded == sizeRead);
if (fError) {
// we could try to fix up the offset...