diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-12-15 18:26:14 +0100 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-12-21 19:12:52 +0100 |
commit | 74c8b028d42a8c5b080bb861e427f38cedd4ad7c (patch) | |
tree | 067f8e85fd7b4f91903ad2aa32630b7dd0364099 /indra/newview/llviewerwindow.cpp | |
parent | e104f7ce0291ed1f7ab170714e319408bf076221 (diff) |
SL-20743 Use LLMutex in LLImageBase for internal data thread-safety
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ba2b6e1c7c..27ec8d9376 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4890,6 +4890,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { return FALSE; } + //check if there is enough memory for the snapshot image if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K { @@ -5008,6 +5009,9 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei image_buffer_x = llfloor(snapshot_width * scale_factor) ; image_buffer_y = llfloor(snapshot_height * scale_factor) ; } + + LLImageDataLock lock(raw); + if ((image_buffer_x > 0) && (image_buffer_y > 0)) { raw->resize(image_buffer_x, image_buffer_y, 3); @@ -5266,6 +5270,8 @@ BOOL LLViewerWindow::simpleSnapshot(LLImageRaw* raw, S32 image_width, S32 image_ display(do_rebuild, zoom, subfield, for_snapshot); } + LLImageDataSharedLock lock(raw); + glReadPixels( 0, 0, image_width, |