diff --git a/liborbis2d/source/orbis2d.c b/liborbis2d/source/orbis2d.c index aa77cd0..b1b8f5f 100755 --- a/liborbis2d/source/orbis2d.c +++ b/liborbis2d/source/orbis2d.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include @@ -172,14 +172,13 @@ void orbis2dStartDrawing() void orbis2dDrawPixelColor(int x, int y, uint32_t pixelColor) { - int color; - int pixel = (y * orbconf->pitch) + x; - - color=pixelColor; - - - ((uint32_t *)orbconf->surfaceAddr[orbconf->currentBuffer])[pixel]=color; + if((x > -1 && x < ATTR_WIDTH) + && (y > -1 && y < ATTR_HEIGHT)) + { + int pixel = (y * orbconf->pitch) + x; + ((uint32_t *)orbconf->surfaceAddr[orbconf->currentBuffer])[pixel] = pixelColor; + } } void orbis2dPutImage(uint32_t *buf,int x, int y, int w, int h) {