diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-03-21 01:37:51 +0100 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-03-21 17:04:48 +0100 |
commit | 275ad3fdabf8417376e01a4a994d4a78dba6f15f (patch) | |
tree | da91046bbc66442978a91c0b8eb76110170e2954 /indra/llrender | |
parent | b1fc17a50e9787163d8d984868050926ef7fa4dc (diff) |
SL-19266 Potential Use-After-Free in LLImageGL::setImage
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 9 |
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; |