Minor tweaks of little consequence. Nullcheck, overrun paranoia.

This commit is contained in:
Shyotl
2011-04-15 02:42:30 -05:00
parent 4d2dde73d7
commit dbd26ddee1
4 changed files with 49 additions and 32 deletions

View File

@@ -1085,8 +1085,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin
U8 packed_buffer[MAX_TE_BUFFER];
U8 *cur_ptr = packed_buffer;
S32 last_face_index = getNumTEs() - 1;
S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1;
if (client_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97") shield = 0;
@@ -1380,7 +1379,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
return retval;
}
face_count = getNumTEs();
face_count = llmin((U32) getNumTEs(), MAX_TES);
U32 i;
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID);