From 888599677ebae40626b1b970b2bcc362e2d94185 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 28 Nov 2024 18:50:55 +0300 Subject: [PATCH] engine: net_chan: fix size of outgoing BZ2 compressed packets --- engine/common/net_chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index 3c5ee6dc..c690181c 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -761,7 +761,7 @@ static void Netchan_CreateFragments_( netchan_t *chan, sizebuf_t *msg ) Con_Reportf( "Compressing split packet with BZip2 (%d -> %d bytes)\n", uSourceSize, uCompressedSize ); memcpy( msg->pData, "BZ2", 4 ); memcpy( msg->pData + 4, pbOut, uCompressedSize ); - MSG_SeekToBit( msg, uCompressedSize << 3, SEEK_SET ); + MSG_SeekToBit( msg, ( uCompressedSize + 4 ) << 3, SEEK_SET ); } } #else