diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 452c6f136c..9c0e3e9708 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -866,11 +866,21 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 { stop_glerror(); - if (prev_mip_data) + // Fix use-after-free + // if (prev_mip_data) + // delete[] prev_mip_data; + // if (cur_mip_data) + // delete[] cur_mip_data; + if (prev_mip_data != cur_mip_data) + { delete[] prev_mip_data; - if (cur_mip_data) - delete[] cur_mip_data; - + } + delete[] cur_mip_data; + + prev_mip_data = nullptr; + cur_mip_data = nullptr; + // +// mGLTextureCreated = false; return FALSE; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 2e26f284d4..29e321cb3c 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2211,7 +2211,18 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, while (dst < end_f32) { +// GCC12 warning: maybe-uninitialized - probably bogus +#if defined(__GNUC__) && (__GNUC__ >= 12) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif +// res0.store4a((F32*) dst); +// GCC12 warning: maybe-uninitialized - probably bogus +#if defined(__GNUC__) && (__GNUC__ >= 12) +#pragma GCC diagnostic pop +#endif +// dst += 4; } @@ -2262,7 +2273,18 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, while (src < end) { LLVector4a tangent_out; +// GCC12 warning: maybe-uninitialized - probably bogus +#if defined(__GNUC__) && (__GNUC__ >= 12) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif +// mat_normal.rotate(*src, tangent_out); +// GCC12 warning: maybe-uninitialized - probably bogus +#if defined(__GNUC__) && (__GNUC__ >= 12) +#pragma GCC diagnostic pop +#endif +// tangent_out.normalize3fast(); tangent_out.setSelectWithMask(mask, *src, tangent_out); tangent_out.store4a(tangents); diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 2552a6c43b..f67d5efe60 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -496,6 +496,13 @@ private: mFetchedSize(f_size), mDecodedSize(d_size), mNeedsAux(false), +// gcc12: -Werror=maybe-uninitialized +#if defined(__GNUC__) && (__GNUC__ >= 12) + mCacheHandle(0), + mCurlState(CURL_NOT_DONE), + mCurlReceivedSize(0), +#endif +// mHttpHandle(LLCORE_HTTP_HANDLE_INVALID) {} };