Fixed remarks.
authorakallabeth <akallabeth@posteo.net>
Thu, 15 Oct 2020 09:03:29 +0000 (11:03 +0200)
committerakallabeth <akallabeth@posteo.net>
Wed, 2 Dec 2020 08:43:22 +0000 (09:43 +0100)
(cherry picked from commit c0284239a759f47670c164e0f3ae9b29676e07f3)

libfreerdp/core/orders.c

index 6db92b0..78d5414 100644 (file)
@@ -1172,13 +1172,13 @@ static INLINE BOOL FIELD_SKIP_BUFFER16(wStream* s, UINT32 TARGET_LEN)
 /* Primary Drawing Orders */
 static BOOL update_read_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt)
 {
 /* Primary Drawing Orders */
 static BOOL update_read_dstblt_order(wStream* s, const ORDER_INFO* orderInfo, DSTBLT_ORDER* dstblt)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &dstblt->nLeftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &dstblt->nTopRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &dstblt->nWidth, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &dstblt->nHeight, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 5, &dstblt->bRop, TRUE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_coord(orderInfo, s, 1, &dstblt->nLeftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &dstblt->nTopRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &dstblt->nWidth, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &dstblt->nHeight, FALSE) &&
+           read_order_field_byte(orderInfo, s, 5, &dstblt->bRop, TRUE))
+               return TRUE;
+       return FALSE;
 }
 int update_approximate_dstblt_order(ORDER_INFO* orderInfo, const DSTBLT_ORDER* dstblt)
 {
 }
 int update_approximate_dstblt_order(ORDER_INFO* orderInfo, const DSTBLT_ORDER* dstblt)
 {
@@ -1204,15 +1204,16 @@ BOOL update_write_dstblt_order(wStream* s, ORDER_INFO* orderInfo, const DSTBLT_O
 }
 static BOOL update_read_patblt_order(wStream* s, const ORDER_INFO* orderInfo, PATBLT_ORDER* patblt)
 {
 }
 static BOOL update_read_patblt_order(wStream* s, const ORDER_INFO* orderInfo, PATBLT_ORDER* patblt)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &patblt->nLeftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &patblt->nTopRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &patblt->nWidth, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &patblt->nHeight, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 5, &patblt->bRop, TRUE) ||
-           !read_order_field_color(orderInfo, s, 6, &patblt->backColor, TRUE) ||
-           !read_order_field_color(orderInfo, s, 7, &patblt->foreColor, TRUE))
-               return FALSE;
-       return update_read_brush(s, &patblt->brush, orderInfo->fieldFlags >> 7);
+       if (read_order_field_coord(orderInfo, s, 1, &patblt->nLeftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &patblt->nTopRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &patblt->nWidth, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &patblt->nHeight, FALSE) &&
+           read_order_field_byte(orderInfo, s, 5, &patblt->bRop, TRUE) &&
+           read_order_field_color(orderInfo, s, 6, &patblt->backColor, TRUE) &&
+           read_order_field_color(orderInfo, s, 7, &patblt->foreColor, TRUE) &&
+           update_read_brush(s, &patblt->brush, orderInfo->fieldFlags >> 7))
+               return TRUE;
+       return FALSE;
 }
 int update_approximate_patblt_order(ORDER_INFO* orderInfo, PATBLT_ORDER* patblt)
 {
 }
 int update_approximate_patblt_order(ORDER_INFO* orderInfo, PATBLT_ORDER* patblt)
 {
@@ -1248,15 +1249,15 @@ BOOL update_write_patblt_order(wStream* s, ORDER_INFO* orderInfo, PATBLT_ORDER*
 }
 static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt)
 {
 }
 static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &scrblt->nLeftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &scrblt->nTopRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &scrblt->nWidth, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &scrblt->nHeight, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 5, &scrblt->bRop, TRUE) ||
-           !read_order_field_coord(orderInfo, s, 6, &scrblt->nXSrc, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 7, &scrblt->nYSrc, FALSE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_coord(orderInfo, s, 1, &scrblt->nLeftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &scrblt->nTopRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &scrblt->nWidth, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &scrblt->nHeight, FALSE) &&
+           read_order_field_byte(orderInfo, s, 5, &scrblt->bRop, TRUE) &&
+           read_order_field_coord(orderInfo, s, 6, &scrblt->nXSrc, FALSE) &&
+           read_order_field_coord(orderInfo, s, 7, &scrblt->nYSrc, FALSE))
+               return TRUE;
+       return FALSE;
 }
 int update_approximate_scrblt_order(ORDER_INFO* orderInfo, const SCRBLT_ORDER* scrblt)
 {
 }
 int update_approximate_scrblt_order(ORDER_INFO* orderInfo, const SCRBLT_ORDER* scrblt)
 {
@@ -1361,13 +1362,13 @@ BOOL update_write_opaque_rect_order(wStream* s, ORDER_INFO* orderInfo,
 static BOOL update_read_draw_nine_grid_order(wStream* s, const ORDER_INFO* orderInfo,
                                              DRAW_NINE_GRID_ORDER* draw_nine_grid)
 {
 static BOOL update_read_draw_nine_grid_order(wStream* s, const ORDER_INFO* orderInfo,
                                              DRAW_NINE_GRID_ORDER* draw_nine_grid)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &draw_nine_grid->srcLeft, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &draw_nine_grid->srcTop, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &draw_nine_grid->srcRight, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &draw_nine_grid->srcBottom, FALSE) ||
-           !read_order_field_uint16(orderInfo, s, 5, &draw_nine_grid->bitmapId, FALSE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_coord(orderInfo, s, 1, &draw_nine_grid->srcLeft, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &draw_nine_grid->srcTop, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &draw_nine_grid->srcRight, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &draw_nine_grid->srcBottom, FALSE) &&
+           read_order_field_uint16(orderInfo, s, 5, &draw_nine_grid->bitmapId, FALSE))
+               return TRUE;
+       return FALSE;
 }
 static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderInfo,
                                            MULTI_DSTBLT_ORDER* multi_dstblt)
 }
 static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderInfo,
                                            MULTI_DSTBLT_ORDER* multi_dstblt)
@@ -1524,18 +1525,18 @@ static BOOL update_read_multi_draw_nine_grid_order(wStream* s, const ORDER_INFO*
 static BOOL update_read_line_to_order(wStream* s, const ORDER_INFO* orderInfo,
                                       LINE_TO_ORDER* line_to)
 {
 static BOOL update_read_line_to_order(wStream* s, const ORDER_INFO* orderInfo,
                                       LINE_TO_ORDER* line_to)
 {
-       if (!read_order_field_uint16(orderInfo, s, 1, &line_to->backMode, TRUE) ||
-           !read_order_field_coord(orderInfo, s, 2, &line_to->nXStart, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &line_to->nYStart, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &line_to->nXEnd, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 5, &line_to->nYEnd, FALSE) ||
-           !read_order_field_color(orderInfo, s, 6, &line_to->backColor, TRUE) ||
-           !read_order_field_byte(orderInfo, s, 7, &line_to->bRop2, TRUE) ||
-           !read_order_field_byte(orderInfo, s, 8, &line_to->penStyle, TRUE) ||
-           !read_order_field_byte(orderInfo, s, 9, &line_to->penWidth, TRUE) ||
-           !read_order_field_color(orderInfo, s, 10, &line_to->penColor, TRUE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_uint16(orderInfo, s, 1, &line_to->backMode, TRUE) &&
+           read_order_field_coord(orderInfo, s, 2, &line_to->nXStart, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &line_to->nYStart, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &line_to->nXEnd, FALSE) &&
+           read_order_field_coord(orderInfo, s, 5, &line_to->nYEnd, FALSE) &&
+           read_order_field_color(orderInfo, s, 6, &line_to->backColor, TRUE) &&
+           read_order_field_byte(orderInfo, s, 7, &line_to->bRop2, TRUE) &&
+           read_order_field_byte(orderInfo, s, 8, &line_to->penStyle, TRUE) &&
+           read_order_field_byte(orderInfo, s, 9, &line_to->penWidth, TRUE) &&
+           read_order_field_color(orderInfo, s, 10, &line_to->penColor, TRUE))
+               return TRUE;
+       return FALSE;
 }
 int update_approximate_line_to_order(ORDER_INFO* orderInfo, const LINE_TO_ORDER* line_to)
 {
 }
 int update_approximate_line_to_order(ORDER_INFO* orderInfo, const LINE_TO_ORDER* line_to)
 {
@@ -1690,14 +1691,14 @@ static BOOL update_read_mem3blt_order(wStream* s, const ORDER_INFO* orderInfo,
 static BOOL update_read_save_bitmap_order(wStream* s, const ORDER_INFO* orderInfo,
                                           SAVE_BITMAP_ORDER* save_bitmap)
 {
 static BOOL update_read_save_bitmap_order(wStream* s, const ORDER_INFO* orderInfo,
                                           SAVE_BITMAP_ORDER* save_bitmap)
 {
-       if (!read_order_field_uint32(orderInfo, s, 1, &save_bitmap->savedBitmapPosition, TRUE) ||
-           !read_order_field_coord(orderInfo, s, 2, &save_bitmap->nLeftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &save_bitmap->nTopRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &save_bitmap->nRightRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 5, &save_bitmap->nBottomRect, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 6, &save_bitmap->operation, TRUE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_uint32(orderInfo, s, 1, &save_bitmap->savedBitmapPosition, TRUE) &&
+           read_order_field_coord(orderInfo, s, 2, &save_bitmap->nLeftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &save_bitmap->nTopRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &save_bitmap->nRightRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 5, &save_bitmap->nBottomRect, FALSE) &&
+           read_order_field_byte(orderInfo, s, 6, &save_bitmap->operation, TRUE))
+               return TRUE;
+       return FALSE;
 }
 static BOOL update_read_glyph_index_order(wStream* s, const ORDER_INFO* orderInfo,
                                           GLYPH_INDEX_ORDER* glyph_index)
 }
 static BOOL update_read_glyph_index_order(wStream* s, const ORDER_INFO* orderInfo,
                                           GLYPH_INDEX_ORDER* glyph_index)
@@ -1986,29 +1987,30 @@ static BOOL update_read_polygon_cb_order(wStream* s, const ORDER_INFO* orderInfo
 static BOOL update_read_ellipse_sc_order(wStream* s, const ORDER_INFO* orderInfo,
                                          ELLIPSE_SC_ORDER* ellipse_sc)
 {
 static BOOL update_read_ellipse_sc_order(wStream* s, const ORDER_INFO* orderInfo,
                                          ELLIPSE_SC_ORDER* ellipse_sc)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &ellipse_sc->leftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &ellipse_sc->topRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &ellipse_sc->rightRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &ellipse_sc->bottomRect, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 5, &ellipse_sc->bRop2, TRUE) ||
-           !read_order_field_byte(orderInfo, s, 6, &ellipse_sc->fillMode, TRUE) ||
-           !read_order_field_color(orderInfo, s, 7, &ellipse_sc->color, TRUE))
-               return FALSE;
-       return TRUE;
+       if (read_order_field_coord(orderInfo, s, 1, &ellipse_sc->leftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &ellipse_sc->topRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &ellipse_sc->rightRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &ellipse_sc->bottomRect, FALSE) &&
+           read_order_field_byte(orderInfo, s, 5, &ellipse_sc->bRop2, TRUE) &&
+           read_order_field_byte(orderInfo, s, 6, &ellipse_sc->fillMode, TRUE) &&
+           read_order_field_color(orderInfo, s, 7, &ellipse_sc->color, TRUE))
+               return TRUE;
+       return FALSE;
 }
 static BOOL update_read_ellipse_cb_order(wStream* s, const ORDER_INFO* orderInfo,
                                          ELLIPSE_CB_ORDER* ellipse_cb)
 {
 }
 static BOOL update_read_ellipse_cb_order(wStream* s, const ORDER_INFO* orderInfo,
                                          ELLIPSE_CB_ORDER* ellipse_cb)
 {
-       if (!read_order_field_coord(orderInfo, s, 1, &ellipse_cb->leftRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 2, &ellipse_cb->topRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 3, &ellipse_cb->rightRect, FALSE) ||
-           !read_order_field_coord(orderInfo, s, 4, &ellipse_cb->bottomRect, FALSE) ||
-           !read_order_field_byte(orderInfo, s, 5, &ellipse_cb->bRop2, TRUE) ||
-           !read_order_field_byte(orderInfo, s, 6, &ellipse_cb->fillMode, TRUE) ||
-           !read_order_field_color(orderInfo, s, 7, &ellipse_cb->backColor, TRUE) ||
-           !read_order_field_color(orderInfo, s, 8, &ellipse_cb->foreColor, TRUE))
-               return FALSE;
-       return update_read_brush(s, &ellipse_cb->brush, orderInfo->fieldFlags >> 8);
+       if (read_order_field_coord(orderInfo, s, 1, &ellipse_cb->leftRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 2, &ellipse_cb->topRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 3, &ellipse_cb->rightRect, FALSE) &&
+           read_order_field_coord(orderInfo, s, 4, &ellipse_cb->bottomRect, FALSE) &&
+           read_order_field_byte(orderInfo, s, 5, &ellipse_cb->bRop2, TRUE) &&
+           read_order_field_byte(orderInfo, s, 6, &ellipse_cb->fillMode, TRUE) &&
+           read_order_field_color(orderInfo, s, 7, &ellipse_cb->backColor, TRUE) &&
+           read_order_field_color(orderInfo, s, 8, &ellipse_cb->foreColor, TRUE) &&
+           update_read_brush(s, &ellipse_cb->brush, orderInfo->fieldFlags >> 8))
+               return TRUE;
+       return FALSE;
 }
 /* Secondary Drawing Orders */
 static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wStream* s,
 }
 /* Secondary Drawing Orders */
 static CACHE_BITMAP_ORDER* update_read_cache_bitmap_order(rdpUpdate* update, wStream* s,