From c3f92f797b334827fd235a233cce4c9fcabe66eb Mon Sep 17 00:00:00 2001 From: Niels Elburg Date: Sun, 18 Jan 2009 12:36:48 +0000 Subject: [PATCH] added oob check to bathroom window git-svn-id: svn://code.dyne.org/veejay/trunk@1307 eb8d1916-c9e9-0310-b8de-cf0c9472ead5 --- veejay-current/veejay-server/libvje/effects/bathroom.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/veejay-current/veejay-server/libvje/effects/bathroom.c b/veejay-current/veejay-server/libvje/effects/bathroom.c index ae084e51..a6cc587f 100644 --- a/veejay-current/veejay-server/libvje/effects/bathroom.c +++ b/veejay-current/veejay-server/libvje/effects/bathroom.c @@ -113,6 +113,7 @@ void bathroom_hori_apply(VJFrame *frame, int width, int height, int val) unsigned int i; unsigned int len = (width * height); unsigned int y_val = val; + unsigned int tmp = 0; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -125,7 +126,10 @@ void bathroom_hori_apply(VJFrame *frame, int width, int height, int val) for(y=0; y < height;y++) { for(x=0; x >1)) + x; - if(i < 0) i += width; + //while(i < 0) i += width; + + if( i < 0 ) i = 0; else if ( i >= len ) i = (len-1); + Y[(y*width)+x] = bathroom_frame[0][i]; Cb[(y*width)+x] = bathroom_frame[1][i]; Cr[(y*width)+x] = bathroom_frame[2][i];