diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2016-12-16 17:03:45 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2016-12-16 17:03:45 -0500 |
commit | 93268cb47a69b8432068c0922feedc01c96ae975 (patch) | |
tree | 55b825e089dd380a3c1aae0d636ff230fc501933 /indra/llrender/llvertexbuffer.h | |
parent | aa5a591aa722c81de2b22d9126afa4a833d0c050 (diff) |
DRTVWR-418: Put TYPE_INDEX within TYPE_MAX: stop undefined indexing.
LLVertexBuffer::TYPE_INDEX was past TYPE_MAX, which is used to set the maximum
sizes of various (scattered) arrays, bleh. The alarm bells that this SHOULD
set off are indeed correct: TYPE_INDEX was being used to index at least one of
those arrays, meaning we've been indexing past the end of that array, meaning
undefined behavior.
The enum that defines both TYPE_INDEX and TYPE_MAX provides a helpful comment
indicating what things must be updated when modifying the enum. (Far better to
define things centrally in a single place... but another time.) Update the
designated arrays to include a final TYPE_INDEX entry. Contents of those
entries are wild guesses -- but even wild guesses are better than completely
indeterminate data.
Diffstat (limited to 'indra/llrender/llvertexbuffer.h')
-rw-r--r-- | indra/llrender/llvertexbuffer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index c05fd01595..36038eee7b 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -179,8 +179,8 @@ public: TYPE_WEIGHT4, TYPE_CLOTHWEIGHT, TYPE_TEXTURE_INDEX, + TYPE_INDEX, TYPE_MAX, - TYPE_INDEX, }; enum { MAP_VERTEX = (1<<TYPE_VERTEX), |