bitblt.c

changeset 33
44d823824a46
parent 11
30d18cf8bb67
child 35
41804cc569ab
     1.1 diff -r 3aac131058da -r 44d823824a46 bitblt.c
     1.2 --- a/bitblt.c	Tue Jan 01 10:16:50 2002 +0000
     1.3 +++ b/bitblt.c	Tue Jan 01 10:18:33 2002 +0000
     1.4 @@ -50,7 +50,8 @@
     1.5  boolean get_pixel (Bitmap *bitmap, Point coord)
     1.6  {
     1.7    u8 *p;
     1.8 -  if ((coord.x >= bitmap->width) || (coord.y >= bitmap->height))
     1.9 +  if ((coord.x < 0) || (coord.y < 0) ||
    1.10 +      (coord.x >= bitmap->width) || (coord.y >= bitmap->height))
    1.11      return (0);
    1.12    p = bitmap->bits + coord.y * bitmap->rowbytes + coord.x / 8;
    1.13    return ((*p & pixel_mask (coord.x & 7)) != 0);
    1.14 @@ -59,7 +60,8 @@
    1.15  void set_pixel (Bitmap *bitmap, Point coord, boolean value)
    1.16  {
    1.17    u8 *p;
    1.18 -  if ((coord.x >= bitmap->width) || (coord.y >= bitmap->height))
    1.19 +  if ((coord.x < 0) || (coord.y < 0) ||
    1.20 +      (coord.x >= bitmap->width) || (coord.y >= bitmap->height))
    1.21      return;
    1.22    p = bitmap->bits + coord.y * bitmap->rowbytes + coord.x / 8;
    1.23    if (value)
    1.24 @@ -77,7 +79,6 @@
    1.25  		int tfn)
    1.26  {
    1.27    Point src_point, dest_point;
    1.28 -  boolean src_pixel, dest_pixel;
    1.29  
    1.30    if (! dest_bitmap)
    1.31      {