Skip to content

Commit

Permalink
Merge pull request #3783 from WasabiFan/fix-libuvc-local-variable-cap…
Browse files Browse the repository at this point in the history
…ture

libuvc: fix undefined behavior caused by capture-by-reference of local variable
  • Loading branch information
dorodnic authored Apr 28, 2019
2 parents 84ac6b5 + 743fd18 commit d353193
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libuvc/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ uvc_error_t uvc_stream_start(
* with the contents of each frame.
*/
if (cb) {
strmh->cb_thread = std::thread([&]() {_uvc_user_caller((void*)strmh); });
strmh->cb_thread = std::thread([strmh]() {_uvc_user_caller((void*)strmh); });
}

for (transfer_id = 0; transfer_id < LIBUVC_NUM_TRANSFER_BUFS;
Expand Down

0 comments on commit d353193

Please sign in to comment.