diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2019-11-11 13:54:34 -0800 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2019-11-11 16:16:14 -0800 |
commit | b5f4c2ab97092bc03c2cfcf02701fdb8c831ec39 (patch) | |
tree | d4a28cad75e53291df454efe93333ee0c83b20c9 | |
parent | b03eb11e8c1c4277326aa2df6a5f49f148151782 (diff) | |
download | av-b5f4c2ab97092bc03c2cfcf02701fdb8c831ec39.tar.gz |
hardware: google: av: media: fix -Wdangling-gsl
linearBlock() constructs a temporary variable. front() refers to a
temporary object that's no longer valid at the end of the expression.
Bug: 139945549
Test: mm
Change-Id: Iabf0a1c34f2e086138339065c4bf55bba7ce7d4a
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
-rw-r--r-- | media/sfplugin/CCodecBufferChannel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/media/sfplugin/CCodecBufferChannel.cpp b/media/sfplugin/CCodecBufferChannel.cpp index 247eb9b..d4b08c1 100644 --- a/media/sfplugin/CCodecBufferChannel.cpp +++ b/media/sfplugin/CCodecBufferChannel.cpp @@ -1162,9 +1162,9 @@ public: switch (c2buffer->data().type()) { case C2BufferData::LINEAR: { uint32_t size = kLinearBufferSize; - const C2ConstLinearBlock &block = c2buffer->data().linearBlocks().front(); - if (block.size() < kMaxLinearBufferSize / 2) { - size = block.size() * 2; + const size_t blockSize = c2buffer->data().linearBlocks().front().size(); + if (blockSize < kMaxLinearBufferSize / 2) { + size = blockSize * 2; } else { size = kMaxLinearBufferSize; } |