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
This commit is contained in:
James R 2025-07-15 14:53:43 -07:00
parent 23b4b83c7c
commit c896aec5e3

View file

@ -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)