summaryrefslogtreecommitdiff
path: root/src/qcommon/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/msg.c')
-rw-r--r--src/qcommon/msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c
index aaed712a..f7001d7b 100644
--- a/src/qcommon/msg.c
+++ b/src/qcommon/msg.c
@@ -247,7 +247,7 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
}
msg->readcount = (msg->bit>>3)+1;
}
- if ( sgn ) {
+ if ( sgn && bits > 0 && bits < 32 ) {
if ( value & ( 1 << ( bits - 1 ) ) ) {
value |= -1 ^ ( ( 1 << bits ) - 1 );
}