From 5a2f71b0bc30804c3ca40ac4fc49e1257ad43106 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Oct 2012 18:18:06 -0500 Subject: MAINT-1527 Fix for crash on exit when VBO disabled --- indra/newview/pipeline.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2edb5cf852..b42a84da47 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -695,6 +695,8 @@ void LLPipeline::cleanup() mInitialized = FALSE; mDeferredVB = NULL; + + mCubeVB = NULL; } //============================================================================ -- cgit v1.2.3 From 11017315e6f0cdcc247a875e41d027beac8df764 Mon Sep 17 00:00:00 2001 From: William Todd Stinson Date: Thu, 18 Oct 2012 17:36:57 -0700 Subject: MAINT-1753: Correcting behavior of ll_aligned_realloc_16() on Linux to avoid memory corruption in the case that the new memory size requested is smaller than the old memory size. Also, adding check to ensure that the aligned malloc returns a non-null value before memcopying. --- indra/llcommon/llmemory.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 40cde485cf..10013e0f92 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -87,7 +87,11 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r void* ret = ll_aligned_malloc_16(size); if (ptr) { - memcpy(ret, ptr, old_size); + if (ret) + { + // Only copy the size of the smallest memory block to avoid memory corruption. + memcpy(ret, ptr, llmin(old_size, size)); + } ll_aligned_free_16(ptr); } return ret; -- cgit v1.2.3