From 3a855e93821a9ded3cf00db4e93f2b3443e31ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8ger=20Hanseg=C3=A5rd?= Date: Mon, 8 Jan 2024 13:39:46 +0100 Subject: Fix CodeChecker warning in qvideotexturehelper CodeChecker reported warning in qvideotexturehelper.cpp line:638 after commit 70c4bf4c565c3ace547f5cbd0398953fcd1ff4f3 Passing result of std::move() as a const reference argument; no move will actually happen in file:src/multimedia/video/qvideotexturehelper.cpp line:638 col:32 subresDesc.setData(std::move(underlyingByteArray)); This patch fixes this issue by not calling std::move. Pick-to: 6.6 6.5 Change-Id: I04b1fcb4a3e0ce3436f184f4db6ed4b6b512f459 Reviewed-by: Artem Dyomin Reviewed-by: Lars Knoll (cherry picked from commit 4f6251cc3f20bf95c6727ea0907a4f7f34dae914) Reviewed-by: Qt Cherry-pick Bot --- src/multimedia/video/qvideotexturehelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index f91ed3daa..a0a87b24a 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -631,11 +631,11 @@ static bool updateTextureWithMap(QVideoFrame frame, QRhi *rhi, QRhiResourceUpdat } else { const auto frameBits = reinterpret_cast(frame.bits(plane)); const auto mappedBytes = frame.mappedBytes(plane); - auto underlyingByteArray = frame.videoBuffer()->underlyingByteArray(plane); + const auto underlyingByteArray = frame.videoBuffer()->underlyingByteArray(plane); if (underlyingByteArray.size() == mappedBytes) { Q_ASSERT(underlyingByteArray.constData() == frameBits); - subresDesc.setData(std::move(underlyingByteArray)); + subresDesc.setData(underlyingByteArray); } else { subresDesc.setData(QByteArray::fromRawData(frameBits, mappedBytes)); -- cgit v1.2.3