am 7496e153: am 0d208173: DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes

* commit '7496e153f4308b39df9c53615770f44f593c3504':
  DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes
This commit is contained in:
Leon Scroggins III
2015-06-02 13:12:12 +00:00
committed by Android Git Automerger

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);
}