From 15e11b7144b8bb42073ec0efbe638c91364a3a9b Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 6 Apr 2009 18:06:06 +0000 Subject: [PATCH] Fix crash when rotating a tiny brush (bug from original version, was harmless in DOS due to lack of memory protection) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@726 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- brush.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/brush.c b/brush.c index b36c4f92..089b207c 100644 --- a/brush.c +++ b/brush.c @@ -1549,8 +1549,8 @@ void Compute_quad_texture(int x1,int y1,int xt1,int yt1, temp=(float)(0.5+(float)x-ScanY_X[0][y])/(float)line_width; xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y]))); yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); - - buffer[x+(y*width)]=Read_pixel_from_brush(xt,yt); + if (xt>=0 && yt>=0) + buffer[x+(y*width)]=Read_pixel_from_brush(xt,yt); } for (; x=0 && yt>=0) + { + color=Read_pixel_from_brush(xt,yt); + if (color!=Back_color) + Pixel_preview(x,y_,color); + } } }