Skip to content
Permalink
Browse files Browse the repository at this point in the history
Bug 704834: Fix division by zero for zero width pages in muraster.
  • Loading branch information
sebras committed Jan 18, 2022
1 parent 85a28b9 commit 22c47ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/tools/muraster.c
Expand Up @@ -1003,8 +1003,9 @@ initialise_banding(fz_context *ctx, render_details *render, int color)

w = render->ibounds.x1 - render->ibounds.x0;
min_band_mem = (size_t)bpp * w * min_band_height;
reps = (int)(max_band_memory / min_band_mem);
if (reps < 1)
if (min_band_mem > 0)
reps = (int)(max_band_memory / min_band_mem);
if (min_band_mem == 0 || reps < 1)
reps = 1;

/* Adjust reps to even out the work between threads */
Expand Down

0 comments on commit 22c47ac

Please sign in to comment.