From 49d463313488010653b32ad6b255dc3c8cc22260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 31 Mar 2003 16:40:57 +0200 Subject: [PATCH] Fixed bad nesting of THREADS_ALLOW()/THREADS_DISALLOW() in img_box_nocheck(). Rev: src/modules/Image/blit.c:1.55 --- src/modules/Image/blit.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/modules/Image/blit.c b/src/modules/Image/blit.c index 91978a07f7..3f65671f99 100644 --- a/src/modules/Image/blit.c +++ b/src/modules/Image/blit.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: blit.c,v 1.54 2002/10/21 17:06:13 marcus Exp $ +|| $Id: blit.c,v 1.55 2003/03/31 14:40:57 grubba Exp $ */ #include "global.h" @@ -160,28 +160,32 @@ void img_box_nocheck(INT32 x1,INT32 y1,INT32 x2,INT32 y2) foo=this->img+x1+y1*this->xsize; end=this->img+x2+y2*this->xsize+1; - THREADS_ALLOW(); - do { - if(!this->alpha) - { - if(!mod) - img_clear(foo,rgb,end-foo); - else { + if(!this->alpha) + { + if(!mod) + img_clear(foo,rgb,end-foo); + else { + THREADS_ALLOW(); + do { int length = x2-x1+1, xs=this->xsize, y=y2-y1+1; rgb_group *from = foo; if(!length) break; /* Break to the while(0). */ for(x=0; x<length; x++) *(foo+x) = rgb; while(--y) MEMCPY((foo+=xs), from, length*sizeof(rgb_group)); - } - } - else - { + } while(0); + THREADS_DISALLOW(); + } + } + else + { + THREADS_ALLOW(); + do { for (; foo<=end; foo+=mod) for (x=x1; x<=x2; x++,foo++) set_rgb_group_alpha(*foo,rgb,this->alpha); - } - } while(0); - THREADS_DISALLOW(); + } while(0); + THREADS_DISALLOW(); + } } -- GitLab