mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
intel: Avoid divide by zero for very small linear blits
If size is small (such as 1), pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4); makes pitch = 0. Then height = size / pitch; causes a division-by-zero exception. If pitch is zero, set height to 1 and avoid the division. This fixes piglit's bin/getteximage-formats test and glean's bufferObject test. NOTE: This is a candidate for the 8.0 release branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44971
This commit is contained in:
parent
65b096aedd
commit
d59466279e
1 changed files with 1 additions and 1 deletions
|
|
@ -492,7 +492,7 @@ intel_emit_linear_blit(struct intel_context *intel,
|
|||
* rounding that down to the nearest DWORD is 1 << 15 - 4
|
||||
*/
|
||||
pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
|
||||
height = size / pitch;
|
||||
height = (pitch == 0) ? 1 : size / pitch;
|
||||
ok = intelEmitCopyBlit(intel, 1,
|
||||
pitch, src_bo, src_offset, I915_TILING_NONE,
|
||||
pitch, dst_bo, dst_offset, I915_TILING_NONE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue