X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fpolytmpl.h;h=12df420c66295c1ec22768087cd52d1be309cead;hp=db5997a2774f64180bb74c8966dedd533fb467bf;hb=1723e332319e7732473814dfc168a13d0bafccb4;hpb=1bd8af3c3c9ec41903590d6ad24ff6313a5cc19b diff --git a/src/polytmpl.h b/src/polytmpl.h index db5997a..12df420 100644 --- a/src/polytmpl.h +++ b/src/polytmpl.h @@ -93,8 +93,9 @@ void POLYFILL(struct pvertex *pv, int nverts) if(pv[i].y > pv[botidx].y) botidx = i; } - left = alloca(pfill_fb.height * sizeof *left); - right = alloca(pfill_fb.height * sizeof *right); + /* +1 to avoid crashing due to off-by-one rounding errors in the rasterization */ + left = alloca((pfill_fb.height + 1) * sizeof *left); + right = alloca((pfill_fb.height + 1) * sizeof *right); for(i=0; i