From: Brian Paul Date: Mon, 18 Sep 2006 15:03:04 +0000 (+0000) Subject: check for n <= 1 in compute_min_mag_ranges(), bug 8320 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=876b41bc03c9a92263b824378fc2191f85e0a403;p=mesa.git check for n <= 1 in compute_min_mag_ranges(), bug 8320 --- diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 629b4ec1369..f55e23422d4 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -590,13 +590,13 @@ compute_min_mag_ranges(const struct gl_texture_object *tObj, } #endif /* DEBUG */ - if (lambda[0] <= minMagThresh && lambda[n-1] <= minMagThresh) { + if (lambda[0] <= minMagThresh && (n <= 1 || lambda[n-1] <= minMagThresh)) { /* magnification for whole span */ *magStart = 0; *magEnd = n; *minStart = *minEnd = 0; } - else if (lambda[0] > minMagThresh && lambda[n-1] > minMagThresh) { + else if (lambda[0] > minMagThresh && (n <=1 || lambda[n-1] > minMagThresh)) { /* minification for whole span */ *minStart = 0; *minEnd = n;