From 743fd18e278121d895ed2e478e0842a716622a80 Mon Sep 17 00:00:00 2001 From: Kaelin Laundry Date: Wed, 17 Apr 2019 17:18:11 -0700 Subject: [PATCH] libuvc: fix undefined behavior caused by capture-by-reference of local variable It appears this was introduced in 9d17956c82e79e72f4e12df40bd0f8848bec11a5. --- src/libuvc/stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libuvc/stream.cpp b/src/libuvc/stream.cpp index 1c52a62902..edce19afa4 100644 --- a/src/libuvc/stream.cpp +++ b/src/libuvc/stream.cpp @@ -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;