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

Commit ef75163e authored by Chong Zhang's avatar Chong Zhang
Browse files

Add minimum size check for ImageGrid atom

bug: 73927042
Change-Id: I25dc3aeabe95bd907a418b12b2d06f3691cb1b42
parent 2b56665e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1335,7 +1335,8 @@ status_t ItemTable::buildImageItemsIfPossible(uint32_t type) {
        ALOGV("adding %s: itemId %d", image.isGrid() ? "grid" : "image", info.itemId);

        if (image.isGrid()) {
            if (size > 12) {
            // ImageGrid struct is at least 8-byte, at most 12-byte (if flags&1)
            if (size < 8 || size > 12) {
                return ERROR_MALFORMED;
            }
            uint8_t buf[12];