Browse Source

llvmpipe: Fix zero-division in llvmpipe_texture_layout()

Fix the crash of "gnome-control-center info" invocation on QEMU where
zero height is passed at init.

(sroland: simplify logic by eliminating the div altogether, using 64bit mul.)

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=879462

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
tags/10.3-branchpoint
Takashi Iwai 11 years ago
parent
commit
6b8b17153a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/gallium/drivers/llvmpipe/lp_texture.c

+ 1
- 1
src/gallium/drivers/llvmpipe/lp_texture.c View File

@@ -115,7 +115,7 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
lpr->row_stride[level] = align(nblocksx * block_size, util_cpu_caps.cacheline);

/* if row_stride * height > LP_MAX_TEXTURE_SIZE */
if (lpr->row_stride[level] > LP_MAX_TEXTURE_SIZE / nblocksy) {
if ((uint64_t)lpr->row_stride[level] * nblocksy > LP_MAX_TEXTURE_SIZE) {
/* image too large */
goto fail;
}

Loading…
Cancel
Save