DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes

bug: 20883006
Change-Id: I4f109667fb210a80fbddddf5f1bfb7ef3a02b6ce
This commit is contained in:
Leon Scroggins III
2015-05-29 16:13:11 -04:00
committed by Leon Scroggins
parent c7a558fe73
commit 6549eed89e

View File

@@ -218,7 +218,12 @@ static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
return NULL;
}
SkRegion* region = new SkRegion;
region->readFromMemory(regionData, size);
size_t actualSize = region->readFromMemory(regionData, size);
if (size != actualSize) {
delete region;
return NULL;
}
return reinterpret_cast<jlong>(region);
}