--- sourceforge.net/trunk/rdesktop/rdp.c 2002/12/10 17:24:27 283 +++ sourceforge.net/trunk/rdesktop/rdp.c 2003/02/04 05:32:13 309 @@ -579,10 +579,10 @@ if (!compress) { int y; - bmpdata = xmalloc(width * height); + bmpdata = xmalloc(width * height * (bpp / 8)); for (y = 0; y < height; y++) { - in_uint8a(s, &bmpdata[(height - y - 1) * width], width); + in_uint8a(s, &bmpdata[(height - y - 1) * (width * (bpp / 8))], width * (bpp / 8)); } ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); xfree(bmpdata); @@ -593,13 +593,11 @@ in_uint16_le(s, size); in_uint8s(s, 4); /* line_size, final_size */ in_uint8p(s, data, size); - - bmpdata = xmalloc(width * height); - if (bitmap_decompress(bmpdata, width, height, data, size)) + bmpdata = xmalloc(width * height * (bpp / 8)); + if (bitmap_decompress(bmpdata, width, height, data, size, bpp)) { ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); } - xfree(bmpdata); } }