am 252893df: Merge "Check that the parcel contained the expected amount of region data." into mnc-dev
* commit '252893df572256657d02b08eb52596bc9e82d5cc': Check that the parcel contained the expected amount of region data.
This commit is contained in:
@@ -212,10 +212,14 @@ static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
|
||||
|
||||
android::Parcel* p = android::parcelForJavaObject(env, parcel);
|
||||
|
||||
SkRegion* region = new SkRegion;
|
||||
size_t size = p->readInt32();
|
||||
size_t actualSize = region->readFromMemory(p->readInplace(size), size);
|
||||
const size_t size = p->readInt32();
|
||||
const void* regionData = p->readInplace(size);
|
||||
if (regionData == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
SkRegion* region = new SkRegion;
|
||||
size_t actualSize = region->readFromMemory(regionData, size);
|
||||
if (size != actualSize) {
|
||||
delete region;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user