Fix GraphicBuffer leak in bufferqueue@2.0
Converting AHardwareBuffer to GraphicBuffer* will automatically
increase an underlying reference count. The copy assignment operator of
sp<GraphicBuffer> will increase a reference count another time, causing
memory leak.
Calling AHardwareBuffer_release() will remove the extra reference count
and fix the leak.
Test: Enable Codec2, then run
cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice
Bug: 126205083
Change-Id: Ib67d1714c50d650ff88cf8487a0c306a08a793d3
1 file changed