diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-07-20 04:37:29 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-07-20 04:37:29 +0400 |
commit | ae9f13e776105aa83a756f8f009f78789dda1515 (patch) | |
tree | 220971b42ad36e12efb44eb1d9957a94ddd3c6fc /src | |
parent | 3d8e058017d71534fbcb5c7d318b28d57c937049 (diff) |
PacketDataStream bug for negative numbers > 32 bit
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@645 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'src')
-rw-r--r-- | src/Message.cpp | 2 | ||||
-rw-r--r-- | src/PacketDataStream.h | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/Message.cpp b/src/Message.cpp index a71159bba..e290b70e0 100644 --- a/src/Message.cpp +++ b/src/Message.cpp @@ -152,7 +152,7 @@ Message *Message::networkToMessage(PacketDataStream &qdsIn) { } else if (qdsIn.left() != 0) { delete mMsg; mMsg = NULL; - qWarning("Message: %d[%d] Long packet: %d leftover bytes", iMessageType, uiSession, qdsIn.left()); + qWarning("Message: %d[%d] Long packet: %d/%d leftover bytes", iMessageType, uiSession, qdsIn.left(), qdsIn.size()); } else if (! mMsg->isValid()) { delete mMsg; mMsg = NULL; diff --git a/src/PacketDataStream.h b/src/PacketDataStream.h index 8084392f9..981494aad 100644 --- a/src/PacketDataStream.h +++ b/src/PacketDataStream.h @@ -190,7 +190,6 @@ class PacketDataStream { PacketDataStream &operator >>(quint64 &i) { quint32 v = next(); - bool invert = false; if ((v & 0xF0) == 0xF0) { switch (v & 0xFC) { case 0xF0: @@ -200,9 +199,9 @@ class PacketDataStream { i=next() << 56 | next() << 48 | next() << 40 | next() << 32 | next() << 24 | next() << 16 | next() << 8 | next(); return *this; case 0xF8: - invert = true; - v = next(); - break; + *this >> i; + i = ~i; + return *this; case 0xFC: i=v & 0x03; i = ~i; @@ -222,8 +221,6 @@ class PacketDataStream { } else { i=(v & 0x7F); } - if (invert) - i = ~i; return *this; } |