am b36ace74: Merge "Check that the parcel contained the expected amount of region data. DO NOT MERGE" into lmp-dev

* commit 'b36ace7401c0e198ceddd2fdb908346b7bb5928f':
  Check that the parcel contained the expected amount of region data. DO NOT MERGE
This commit is contained in:
Leon Scroggins III
2015-05-27 14:39:21 +00:00
committed by Android Git Automerger

View File

@@ -212,9 +212,13 @@ static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
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 reinterpret_cast<jlong>(region);
}