From: Armin Novak Date: Mon, 1 Aug 2016 14:37:26 +0000 (+0200) Subject: Fixed splitting of color planes. X-Git-Tag: 2.0.0-beta1+android10~160^2~140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4d89067b2d834ef89d7ff8999cda124eb082cba;p=platform%2Fupstream%2Ffreerdp.git Fixed splitting of color planes. --- diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index d1b1f2c..5059169 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -678,18 +678,21 @@ static BOOL freerdp_split_color_planes(const BYTE* data, UINT32 format, UINT32 scanline, BYTE** planes) { INT32 i, j, k; - UINT32* pixel; k = 0; + if (scanline == 0) + scanline = width * GetBytesPerPixel(format); + for (i = height - 1; i >= 0; i--) { - pixel = (UINT32*) &data[scanline * i]; + const BYTE* pixel = &data[scanline * i]; for (j = 0; j < width; j++) { - *pixel = GetColor(format, planes[1][k], planes[2][k], - planes[3][k], planes[0][k]); - pixel++; + const UINT32 color = ReadColor(pixel, format); + pixel += GetBytesPerPixel(format); + SplitColor(color, format, &planes[1][k], &planes[2][k], + &planes[3][k], &planes[0][k], NULL); k++; } } @@ -1082,12 +1085,12 @@ BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, if (context->AllowRunLengthEncoding) { if (!freerdp_bitmap_planar_delta_encode_planes( - (const BYTE**)context->planes, width, height, + context->planes, width, height, context->deltaPlanes)) return NULL;; if (freerdp_bitmap_planar_compress_planes_rle( - (const BYTE**)context->deltaPlanes, width, height, + context->deltaPlanes, width, height, context->rlePlanesBuffer, dstSizes, context->AllowSkipAlpha) > 0) {