Commit e777b139 authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Fix possible use-after-move in MediaDevicesManager

A result was unnecessarily moved and possibly used after move
in content::MediaDevicesManager::OnDevicesEnumerated.

Existing unit tests cover the affected code path, although it
does not result in a crash, perhaps because the move is
unnecessary and might be optimized away.

No crashes have been observed in the wild either, except on
a clusterfuzz build that performs IPC directly instead of going
through the getCapabilities() JavaScript API.

Bug: 868241
Change-Id: I2a3d9704a789c67b9eb763e1257504187201f941
Reviewed-on: https://chromium-review.googlesource.com/1154911Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579026}
parent a61a8eaa
......@@ -693,7 +693,7 @@ void MediaDevicesManager::OnDevicesEnumerated(
}
}
std::move(callback).Run(std::move(result),
std::move(callback).Run(result,
video_input_capabilities_requested
? ComputeVideoInputCapabilities(
enumeration[MEDIA_DEVICE_TYPE_VIDEO_INPUT],
......
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