From 6340024daa906a4ecd8e3b0f760cec162332d4db Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 18 Mar 2014 17:42:58 -0700 Subject: [PATCH] fix bad startPosition in datagram unpack The startPosition was wrong (too far back) and the bytesRead return value was too big and the unpacking of the second chunk of the datagram would start in the middle of the chunk. --- libraries/avatars/src/AvatarData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 8ed0ce51ec..e5e0e4b3d7 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -176,8 +176,8 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) { _handData = new HandData(this); } - const unsigned char* startPosition = reinterpret_cast(packet.data()); - const unsigned char* sourceBuffer = startPosition + offset; + const unsigned char* startPosition = reinterpret_cast(packet.data()) + offset; + const unsigned char* sourceBuffer = startPosition; // Body world position memcpy(&_position, sourceBuffer, sizeof(float) * 3);