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

Commit 0d208173 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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

bug: 20883006
Change-Id: I4f109667fb210a80fbddddf5f1bfb7ef3a02b6ce
parent 18d79267
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
}