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

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

Fix deleter in HeifDataSource

bug: 112647413
Test: POC; CTS MediaMetadataRetrieverTest;
.heic file decoding in Photos

Change-Id: I55ccb4ccb99884295ae02a6f1250a8177875f478
parent b5bda7b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ private:
    sp<IMemory> mMemory;
    std::unique_ptr<HeifStream> mStream;
    bool mEOS;
    std::unique_ptr<uint8_t> mCache;
    std::unique_ptr<uint8_t[]> mCache;
    off64_t mCachedOffset;
    size_t mCachedSize;
    size_t mCacheBufferSize;
@@ -165,7 +165,7 @@ ssize_t HeifDataSource::readAt(off64_t offset, size_t size) {
        // it's reaching max cache buffer size, need to roll window, and possibly
        // expand the cache buffer.
        size_t newCacheBufferSize = mCacheBufferSize;
        std::unique_ptr<uint8_t> newCache;
        std::unique_ptr<uint8_t[]> newCache;
        uint8_t* dst = mCache.get();
        if (newCacheBufferSize < kMaxCacheBufferSize) {
            newCacheBufferSize = kMaxCacheBufferSize;