Commit df553e56 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Chromium LUCI CQ

Fix use-after-move in //c/services/media_gallery_util/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I81b1f6a8fb76d2ca7120a12e7fab1a66156aef11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561391
Commit-Queue: Tommy Li <tommycli@chromium.org>
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831946}
parent 758b2874
......@@ -42,6 +42,7 @@ void MediaParserAndroid::ExtractVideoFrame(
// be deleted when utility process dies or |OnVideoFrameExtracted| callback
// is called.
auto parser = std::make_unique<VideoThumbnailParser>(std::move(data_source));
parser->Start(base::BindOnce(&OnVideoFrameExtracted, std::move(parser),
std::move(video_frame_callback)));
auto* const parser_ptr = parser.get();
parser_ptr->Start(base::BindOnce(&OnVideoFrameExtracted, std::move(parser),
std::move(video_frame_callback)));
}
......@@ -81,7 +81,8 @@ void OnEncodedVideoFrameExtracted(
auto thumbnail_decoder = std::make_unique<media::VideoThumbnailDecoder>(
std::make_unique<media::VpxVideoDecoder>(), config, std::move(data));
thumbnail_decoder->Start(
auto* const thumbnail_decoder_ptr = thumbnail_decoder.get();
thumbnail_decoder_ptr->Start(
base::BindOnce(&OnSoftwareVideoFrameDecoded, std::move(thumbnail_decoder),
std::move(video_frame_callback), config));
}
......@@ -90,9 +91,10 @@ void ExtractVideoFrameOnMediaThread(
media::DataSource* data_source,
MediaParser::ExtractVideoFrameCallback video_frame_callback) {
auto extractor = std::make_unique<media::VideoFrameExtractor>(data_source);
extractor->Start(base::BindOnce(&OnEncodedVideoFrameExtracted,
std::move(extractor),
std::move(video_frame_callback)));
auto* const extractor_ptr = extractor.get();
extractor_ptr->Start(base::BindOnce(&OnEncodedVideoFrameExtracted,
std::move(extractor),
std::move(video_frame_callback)));
}
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment