summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-03-21 01:37:51 +0100
committerGuru <alexandrgproductengine@lindenlab.com>2023-03-21 17:04:48 +0100
commit275ad3fdabf8417376e01a4a994d4a78dba6f15f (patch)
treeda91046bbc66442978a91c0b8eb76110170e2954 /indra/llrender/llimagegl.cpp
parentb1fc17a50e9787163d8d984868050926ef7fa4dc (diff)
SL-19266 Potential Use-After-Free in LLImageGL::setImage
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 9dc140b5b9..465f30a343 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -859,9 +859,16 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32
stop_glerror();
if (prev_mip_data)
- delete[] prev_mip_data;
+ {
+ if (prev_mip_data != cur_mip_data)
+ delete[] prev_mip_data;
+ prev_mip_data = nullptr;
+ }
if (cur_mip_data)
+ {
delete[] cur_mip_data;
+ cur_mip_data = nullptr;
+ }
mGLTextureCreated = false;
return FALSE;