CVS: rdesktop mppc.c,1.8,1.9

Jeroen Meijer <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18102

Modified Files:
	mppc.c 
Log Message:
fix match length decoding for mppc with 64kB history buffer

Index: mppc.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/mppc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** mppc.c	17 Apr 2005 23:14:20 -0000	1.8
--- mppc.c	30 Apr 2005 20:48:05 -0000	1.9
***************
*** 64,67 ****
--- 64,68 ----
  	int match_len;
  	int old_offset, match_bits;
+ 	BOOL big = ctype & RDP_MPPC_BIG ? True : False;
  
  	uint8 *dict = g_mppc_dict.hist;
***************
*** 156,160 ****
  		/* length pair    */
  		walker <<= 1;
! 		if (--walker_len < (ctype & RDP_MPPC_BIG ? 3 : 2))
  		{
  			if (i >= clen)
--- 157,161 ----
  		/* length pair    */
  		walker <<= 1;
! 		if (--walker_len < (big ? 3 : 2))
  		{
  			if (i >= clen)
***************
*** 164,168 ****
  		}
  
! 		if (ctype & RDP_MPPC_BIG)
  		{
  			/* offset decoding where offset len is:
--- 165,169 ----
  		}
  
! 		if (big)
  		{
  			/* offset decoding where offset len is:
***************
*** 316,320 ****
  			   meaning 4096 + 1...
  			 */
! 			match_bits = 11;	/* 11 bits of value at most */
  			do
  			{
--- 317,321 ----
  			   meaning 4096 + 1...
  			 */
! 			match_bits = big ? 14 : 11;	/* 11 or 14 bits of value at most */
  			do
  			{
***************
*** 335,339 ****
  			}
  			while (1);
! 			match_len = 13 - match_bits;
  			walker <<= 1;
  			if (--walker_len < match_len)
--- 336,340 ----
  			}
  			while (1);
! 			match_len = (big ? 16 : 13) - match_bits;
  			walker <<= 1;
  			if (--walker_len < match_len)
***************
*** 361,365 ****
  		}
  		/* memory areas can overlap - meaning we can't use memXXX functions */
! 		k = (next_offset - match_off) & (ctype & RDP_MPPC_BIG ? 65535 : 8191);
  		do
  		{
--- 362,366 ----
  		}
  		/* memory areas can overlap - meaning we can't use memXXX functions */
! 		k = (next_offset - match_off) & (big ? 65535 : 8191);
  		do
  		{



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.