From 38765ba214ad56dab4a7e37000c01df45ea3f5ad Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 6 Sep 2022 12:22:43 +0100 Subject: Bug 705702 continued: Extend fix to other tiling types too. The previous fix was correct, but left the potential problem open for other tiling types. Move/refine the test a bit to ensure it works for all types. --- base/gsptype1.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/base/gsptype1.c b/base/gsptype1.c index a7fa20c54..2e0327162 100644 --- a/base/gsptype1.c +++ b/base/gsptype1.c @@ -227,13 +227,14 @@ gs_pattern1_make_pattern(gs_client_color * pcc, * losing content. */ inst.size.x = (int)floor(bbw+0.5); inst.size.y = (int)floor(bbh+0.5); - /* Ensure we never round down to 0. Or below zero (bug 705768). */ - if (bbw > 0 && inst.size.x <= 0) - inst.size.x = 1; - if (bbh > 0 && inst.size.y <= 0) - inst.size.y = 1; } + /* Ensure we never round down to 0. Or below zero (bug 705768). */ + if (inst.size.x <= 0) + inst.size.x = bbw > 0 ? 1 : 0; + if (inst.size.y <= 0) + inst.size.y = bbh > 0 ? 1 : 0; + /* After compute_inst_matrix above, we are guaranteed that * inst.step_matrix.xx > 0 and inst.step_matrix.yy > 0. * Similarly, we are guaranteed that inst.size.x >= 0 and -- cgit v1.2.1