Check that the parcel contained the expected amount of region data. DO NOT MERGE

bug:20883006
Change-Id: Ib47a8ec8696dbc37e958b8dbceb43fcbabf6605b
This commit is contained in:
Leon Scroggins III
2015-05-26 16:41:09 -04:00
parent 69b8e962e1
commit 18d7926709

View File

@@ -175,9 +175,13 @@ static SkRegion* Region_createFromParcel(JNIEnv* env, jobject clazz, jobject par
android::Parcel* p = android::parcelForJavaObject(env, parcel);
const size_t size = p->readInt32();
const void* regionData = p->readInplace(size);
if (regionData == NULL) {
return NULL;
}
SkRegion* region = new SkRegion;
size_t size = p->readInt32();
region->readFromMemory(p->readInplace(size), size);
region->readFromMemory(regionData, size);
return region;
}