fix a crash when using mirrorhorizontal and resizing a window to width 1
This commit is contained in:
parent
1fbc70da58
commit
6930bdb289
1 changed files with 21 additions and 19 deletions
|
@ -458,6 +458,7 @@ static void gradient_mirrorhorizontal(RrSurface *sf, gint w, gint h)
|
||||||
VARS(x);
|
VARS(x);
|
||||||
SETUP(x, sf->primary, sf->secondary, w/2);
|
SETUP(x, sf->primary, sf->secondary, w/2);
|
||||||
|
|
||||||
|
if (w > 1) {
|
||||||
for (x = w - 1; x > w/2-1; --x) { /* 0 -> w-1 */
|
for (x = w - 1; x > w/2-1; --x) { /* 0 -> w-1 */
|
||||||
current = COLOR(x);
|
current = COLOR(x);
|
||||||
datav = data;
|
datav = data;
|
||||||
|
@ -481,6 +482,7 @@ static void gradient_mirrorhorizontal(RrSurface *sf, gint w, gint h)
|
||||||
|
|
||||||
NEXT(x);
|
NEXT(x);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
current = COLOR(x);
|
current = COLOR(x);
|
||||||
for (y = h - 1; y >= 0; --y) /* 0 -> h */
|
for (y = h - 1; y >= 0; --y) /* 0 -> h */
|
||||||
*(data + y * w) = current;
|
*(data + y * w) = current;
|
||||||
|
|
Loading…
Reference in a new issue