Merge "media: Fix graphic buffer leak."
diff --git a/media/libstagefright/omx/GraphicBufferSource.cpp b/media/libstagefright/omx/GraphicBufferSource.cpp
index 422f87f..63424f7 100644
--- a/media/libstagefright/omx/GraphicBufferSource.cpp
+++ b/media/libstagefright/omx/GraphicBufferSource.cpp
@@ -921,11 +921,12 @@
* frameNum: frame number of the frame being released
* buffer: GraphicBuffer pointer to release (note this must not be & as we
* will clear the original mBufferSlot in persistent case)
+ * Use NOLINT to supress warning on the copy of 'buffer'.
* fence: fence of the frame being released
*/
void GraphicBufferSource::releaseBuffer(
int &id, uint64_t frameNum,
- const sp<GraphicBuffer> &buffer, const sp<Fence> &fence) {
+ const sp<GraphicBuffer> buffer, const sp<Fence> &fence) { // NOLINT
if (mIsPersistent) {
mConsumer->detachBuffer(id);
mBufferSlot[id] = NULL;
diff --git a/media/libstagefright/omx/GraphicBufferSource.h b/media/libstagefright/omx/GraphicBufferSource.h
index 3fcab2b..c8b0e62 100644
--- a/media/libstagefright/omx/GraphicBufferSource.h
+++ b/media/libstagefright/omx/GraphicBufferSource.h
@@ -242,7 +242,7 @@
// Release buffer to the consumer
void releaseBuffer(
int &id, uint64_t frameNum,
- const sp<GraphicBuffer> &buffer, const sp<Fence> &fence);
+ const sp<GraphicBuffer> buffer, const sp<Fence> &fence);
void setLatestBuffer_l(const BufferItem &item, bool dropped);
bool repeatLatestBuffer_l();