CVS: rdesktop bitmap.c,1.19,1.20

Michael Gernoth <[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-serv13819

Modified Files:
	bitmap.c 
Log Message:
unaligned memory-access leads to bus-error on some architectures.
memcpy the value instead of a direct assignment


Index: bitmap.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/bitmap.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** bitmap.c	15 Apr 2004 17:28:30 -0000	1.19
--- bitmap.c	16 Apr 2004 09:11:03 -0000	1.20
***************
*** 331,341 ****
  				break;
  			case 8:	/* Bicolour */
! 				colour1 = CVAL2(input);
  			case 3:	/* Colour */
! 				colour2 = CVAL2(input);
  				break;
  			case 6:	/* SetMix/Mix */
  			case 7:	/* SetMix/FillOrMix */
! 				mix = CVAL2(input);
  				opcode -= 5;
  				break;
--- 331,341 ----
  				break;
  			case 8:	/* Bicolour */
! 				memcpy(&colour1,&CVAL2(input),2);
  			case 3:	/* Colour */
! 				memcpy(&colour2,&CVAL2(input),2);
  				break;
  			case 6:	/* SetMix/Mix */
  			case 7:	/* SetMix/FillOrMix */
! 				memcpy(&mix,&CVAL2(input),2);
  				opcode -= 5;
  				break;
***************
*** 425,429 ****
  					break;
  				case 4:	/* Copy */
! 					REPEAT(line[x] = CVAL2(input))
  					break;
  				case 8:	/* Bicolour */
--- 425,429 ----
  					break;
  				case 4:	/* Copy */
! 					REPEAT(memcpy(&line[x],&CVAL2(input),2))
  					break;
  				case 8:	/* Bicolour */



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
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.