From cd911250609e10e9366b7cfdbdfe9941b5cb0504 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Fri, 16 Apr 2004 09:11:03 +0000 Subject: [PATCH] unaligned memory-access leads to bus-error on some architectures. memcpy the value instead of a direct assignment git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@654 423420c4-83ab-492f-b58f-81f9feb106b5 --- bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitmap.c b/bitmap.c index ec92e5e..9697f81 100644 --- a/bitmap.c +++ b/bitmap.c @@ -330,13 +330,13 @@ bitmap_decompress2(uint8 * output, int width, int height, uint8 * input, int siz insertmix = True; break; case 8: /* Bicolour */ - colour1 = CVAL2(input); + memcpy(&colour1,&CVAL2(input),2); case 3: /* Colour */ - colour2 = CVAL2(input); + memcpy(&colour2,&CVAL2(input),2); break; case 6: /* SetMix/Mix */ case 7: /* SetMix/FillOrMix */ - mix = CVAL2(input); + memcpy(&mix,&CVAL2(input),2); opcode -= 5; break; case 9: /* FillOrMix_1 */ @@ -424,7 +424,7 @@ bitmap_decompress2(uint8 * output, int width, int height, uint8 * input, int siz REPEAT(line[x] = colour2) break; case 4: /* Copy */ - REPEAT(line[x] = CVAL2(input)) + REPEAT(memcpy(&line[x],&CVAL2(input),2)) break; case 8: /* Bicolour */ REPEAT