DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes
bug: 20883006 Change-Id: I4f109667fb210a80fbddddf5f1bfb7ef3a02b6ce
This commit is contained in:
committed by
Leon Scroggins
parent
c7a558fe73
commit
6549eed89e
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user