Skip to content

Commit

Permalink
Fix use-after-move in //media/capture/video/chromeos/
Browse files Browse the repository at this point in the history
Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: Ia1fd975e3e8ed4b4057deb917e11c302307acce1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2557077
Commit-Queue: Ricky Liang <jcliang@chromium.org>
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Ricky Liang <jcliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830881}
  • Loading branch information
Maksim Ivanov authored and Commit Bot committed Nov 25, 2020
1 parent a3d6c9c commit d9c7385
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions media/capture/video/chromeos/stream_buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ void StreamBufferManager::ReserveBufferFromPool(StreamType stream_type) {
stream_context->buffer_dimension, *gfx_format,
stream_context->buffer_usage, base::NullCallback());
stream_context->free_buffers.push(vcd_buffer.id);
stream_context->buffers.insert(std::make_pair(
vcd_buffer.id, BufferPair(std::move(gmb), std::move(vcd_buffer))));
const int id = vcd_buffer.id;
stream_context->buffers.insert(
std::make_pair(id, BufferPair(std::move(gmb), std::move(vcd_buffer))));
}

void StreamBufferManager::DestroyCurrentStreamsAndBuffers() {
Expand Down

0 comments on commit d9c7385

Please sign in to comment.