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

Commit c0fa2711 authored by Dongwon Kang's avatar Dongwon Kang
Browse files

Add a null checking for heic thumbnail data.

Test: run poc with and without the patch
Bug: 79944875
Change-Id: Ie3a9610c19baef65f4a5c7e7f6b8e051b558d663
parent a0d38208
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1529,12 +1529,16 @@ sp<MetaData> ItemTable::getImageMeta(const uint32_t imageIndex) {
        if (thumbItemIndex >= 0) {
            const ImageItem &thumbnail = mItemIdToItemMap[thumbItemIndex];

            if (thumbnail.hvcc != NULL) {
                meta->setInt32(kKeyThumbnailWidth, thumbnail.width);
                meta->setInt32(kKeyThumbnailHeight, thumbnail.height);
                meta->setData(kKeyThumbnailHVCC, kTypeHVCC,
                        thumbnail.hvcc->data(), thumbnail.hvcc->size());
                ALOGV("image[%u]: thumbnail: size %dx%d, item index %zd",
                        imageIndex, thumbnail.width, thumbnail.height, thumbItemIndex);
            } else {
                ALOGW("%s: thumbnail data is missing for image[%u]!", __FUNCTION__, imageIndex);
            }
        } else {
            ALOGW("%s: Referenced thumbnail does not exist!", __FUNCTION__);
        }