25 lines
909 B
Diff
25 lines
909 B
Diff
|
From: Takashi Iwai <tiwai@suse.de>
|
||
|
Subject: Fix zero-division in llvmpipe_texture_layout()
|
||
|
References: bnc#879462
|
||
|
|
||
|
Fix the crash of "gnome-control-center info" invocation on QEMU where
|
||
|
zero height is passed at init.
|
||
|
|
||
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||
|
|
||
|
---
|
||
|
src/gallium/drivers/llvmpipe/lp_texture.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
|
||
|
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
|
||
|
@@ -115,7 +115,7 @@ llvmpipe_texture_layout(struct llvmpipe_
|
||
|
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 (nblocksy && lpr->row_stride[level] > LP_MAX_TEXTURE_SIZE / nblocksy) {
|
||
|
/* image too large */
|
||
|
goto fail;
|
||
|
}
|