From c896aec5e3ddc7f7ac1fdef5bd652b419cd9017a Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 15 Jul 2025 14:53:43 -0700 Subject: [PATCH] Fix screenshot/video recording in Debug builds on GCC 15 - New in GCC 15: std::vector subscript operator asserts if out of range (even past-end) - Solution: use pointer arithmetic where a past-end iterator is needed --- src/hwr2/screen_capture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hwr2/screen_capture.cpp b/src/hwr2/screen_capture.cpp index 5fe68d636..720460003 100644 --- a/src/hwr2/screen_capture.cpp +++ b/src/hwr2/screen_capture.cpp @@ -45,7 +45,8 @@ void ScreenshotPass::capture(Rhi& rhi) { // Read the aligned data into unaligned linear memory, flipping the rows in the process. uint32_t pixel_data_row = (height_ - row) - 1; - std::move(&pixel_data_[pixel_data_row * read_stride], &pixel_data_[pixel_data_row * read_stride + stride], &packed_data_[row * stride]); + uint8_t* pixel_data_row_ptr = &pixel_data_[pixel_data_row * read_stride]; + std::move(pixel_data_row_ptr, pixel_data_row_ptr + stride, &packed_data_[row * stride]); } if (g_takemapthumbnail != TMT_NO)