Browse Source

* Fixed a buffer overflow in antialiased lines

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2782 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
jylam 16 years ago
parent
commit
74388b2c0d
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      pipi/paint/aline_template.h

+ 3
- 3
pipi/paint/aline_template.h View File

@@ -97,7 +97,7 @@ else {
val2 = fractf(yend)*xgap; val2 = fractf(yend)*xgap;


PLOT(ix1, iy1, val1); PLOT(ix1, iy1, val1);
PLOT(ix1, iy1+1, val2);
PLOT(ix1, (iy1+1)<y1?(iy1+1):iy1, val2);


xf = xend + g; xf = xend + g;


@@ -110,7 +110,7 @@ else {
val2 = fractf(yend)*xgap; val2 = fractf(yend)*xgap;


PLOT(ix2, iy2, val1); PLOT(ix2, iy2, val1);
PLOT(ix2, iy2+1, val2);
PLOT(ix2, (iy2+1)<y2?(iy2+1):iy2, val2);




for (y = (iy1+1); y < iy2; y++) for (y = (iy1+1); y < iy2; y++)
@@ -122,7 +122,7 @@ else {
focus = (1.0 - fabsf(val1-val2)); focus = (1.0 - fabsf(val1-val2));
val1 += 0.3*focus; val1 += 0.3*focus;
val2 += 0.3*focus; val2 += 0.3*focus;
PLOT(vx, y, val1);
PLOT(vx, y, val1);
vx++; vx++;
PLOT(vx, y, val2); PLOT(vx, y, val2);
xf = xf + g; xf = xf + g;


Loading…
Cancel
Save