Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a1a1f28 authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android Git Automerger
Browse files

am 252893df: Merge "Check that the parcel contained the expected amount of...

am 252893df: Merge "Check that the parcel contained the expected amount of region data." into mnc-dev

* commit '252893df':
  Check that the parcel contained the expected amount of region data.
parents 785c0a02 252893df
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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;