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

Commit 8c9ae41b authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Android Git Automerger
Browse files

am 303581be: resolved conflicts for merge of 3ff978a5 to cw-d-mr1-dev

* commit '303581be':
  DO NOT MERGE: Ensure that unparcelling Region only reads the expected number of bytes
parents 16c31a77 303581be
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -212,9 +212,19 @@ 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();
    region->readFromMemory(p->readInplace(size), size);
    const void* regionData = p->readInplace(size);
    if (regionData == NULL) {
        return NULL;
    }

    SkRegion* region = new SkRegion;
    size_t actualSize = region->readFromMemory(regionData, size);

    if (size != actualSize) {
        delete region;
        return NULL;
    }

    return reinterpret_cast<jlong>(region);
}