am 6b16398d: am 604ae32b: am 4dae8e41: Merge "DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes" into lmp-dev
* commit '6b16398dd148b38da19a8d5d7f5598fa44fbe7ac': DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes
This commit is contained in:
@@ -218,7 +218,12 @@ static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
SkRegion* region = new SkRegion;
|
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);
|
return reinterpret_cast<jlong>(region);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user