diff options
author | Oz Linden <oz@lindenlab.com> | 2012-10-19 14:06:55 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-10-19 14:06:55 -0400 |
commit | 246d2b9476d787d7d593603eb14f58c0127ee6e1 (patch) | |
tree | 0e552b7fa3c846bbc9450cbabb4a4e06d549ffb8 /indra | |
parent | c8fcb6c798b46ffbffdfa3c04bdb2846a87a60d4 (diff) | |
parent | 04a16d2836b3c8517d367861d3dea632a0d58fc1 (diff) |
merge changes for DRTVWR-233
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llmemory.h | 6 |
1 files changed, 5 insertions, 1 deletions
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; |