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

Commit c36705e4 authored by Jerry Huang's avatar Jerry Huang
Browse files

codec2 hidl plugin samples: free native handles after they are unwrapped

To avoid memory leakage, this patch deletes the used
native handles before exiting.

Bug: 234393036
Test: atest android.media.decoder.cts.DecoderTest#testH265HDR10ToSdr --iterations
Change-Id: Ibfd12d823cfb73c1e2bb03350faec2b781e1d52a
parent 94a233ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -665,6 +665,7 @@ private:
                        grallocHandle, GraphicBuffer::CLONE_HANDLE,
                        width, height, format, 1, usage, stride);

                native_handle_delete(grallocHandle);
                std::shared_ptr<C2GraphicBlock> dstBlock;
                C2BlockPool::local_id_t poolId = mIntf->getPoolId();
                std::shared_ptr<C2BlockPool> pool;
@@ -683,6 +684,7 @@ private:
                        grallocHandle, GraphicBuffer::CLONE_HANDLE,
                        width, height, format, 1, usage, stride);

                native_handle_delete(grallocHandle);
                Rect sourceCrop(0, 0, width, height);

                renderengine::DisplaySettings clientCompositionDisplay;