Skip to content

Commit

Permalink
[core,orders] fix checks for multi opaque rect
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Novak authored and mfleisz committed Aug 28, 2023
1 parent 031c8ba commit 1bbed81
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libfreerdp/core/orders.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/assert.h>

#include <freerdp/api.h>
#include <freerdp/log.h>
Expand Down Expand Up @@ -1403,7 +1404,7 @@ static BOOL update_read_multi_dstblt_order(wStream* s, const ORDER_INFO* orderIn
return update_read_delta_rects(s, multi_dstblt->rectangles, &multi_dstblt->numRectangles);
}

return TRUE;
return multi_dstblt->numRectangles == 0;
}

static BOOL update_read_multi_patblt_order(wStream* s, const ORDER_INFO* orderInfo,
Expand Down Expand Up @@ -1434,13 +1435,19 @@ static BOOL update_read_multi_patblt_order(wStream* s, const ORDER_INFO* orderIn
if (!update_read_delta_rects(s, multi_patblt->rectangles, &multi_patblt->numRectangles))
return FALSE;
}
else if (multi_patblt->numRectangles != 0)
return FALSE;

return TRUE;
}

static BOOL update_read_multi_scrblt_order(wStream* s, const ORDER_INFO* orderInfo,
MULTI_SCRBLT_ORDER* multi_scrblt)
{
WINPR_ASSERT(orderInfo);
WINPR_ASSERT(multi_scrblt);

multi_scrblt->numRectangles = 0;
if (!read_order_field_coord(orderInfo, s, 1, &multi_scrblt->nLeftRect, FALSE) ||
!read_order_field_coord(orderInfo, s, 2, &multi_scrblt->nTopRect, FALSE) ||
!read_order_field_coord(orderInfo, s, 3, &multi_scrblt->nWidth, FALSE) ||
Expand All @@ -1460,7 +1467,7 @@ static BOOL update_read_multi_scrblt_order(wStream* s, const ORDER_INFO* orderIn
return update_read_delta_rects(s, multi_scrblt->rectangles, &multi_scrblt->numRectangles);
}

return TRUE;
return multi_scrblt->numRectangles == 0;
}

static BOOL update_read_multi_opaque_rect_order(wStream* s, const ORDER_INFO* orderInfo,
Expand Down Expand Up @@ -1513,7 +1520,7 @@ static BOOL update_read_multi_opaque_rect_order(wStream* s, const ORDER_INFO* or
&multi_opaque_rect->numRectangles);
}

return TRUE;
return multi_opaque_rect->numRectangles == 0;
}

static BOOL update_read_multi_draw_nine_grid_order(wStream* s, const ORDER_INFO* orderInfo,
Expand All @@ -1537,7 +1544,7 @@ static BOOL update_read_multi_draw_nine_grid_order(wStream* s, const ORDER_INFO*
&multi_draw_nine_grid->nDeltaEntries);
}

return TRUE;
return multi_draw_nine_grid->nDeltaEntries == 0;
}
static BOOL update_read_line_to_order(wStream* s, const ORDER_INFO* orderInfo,
LINE_TO_ORDER* line_to)
Expand Down

0 comments on commit 1bbed81

Please sign in to comment.