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

* commit '0d2081734ce124191ac1f3e8585336daa414abbe':
  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 12:59:29 +00:00
committed by Android Git Automerger

View File

@@ -181,7 +181,12 @@ static SkRegion* Region_createFromParcel(JNIEnv* env, jobject clazz, jobject par
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 region;
}