Fix Haiku bitmap sanity checks
* src/haikufns.c (haiku_get_pixel, haiku_put_pixel): Fix sanity checking of coordinate values.
This commit is contained in:
parent
a89bc0fe9c
commit
cd7e7834ba
1 changed files with 2 additions and 2 deletions
|
@ -1238,7 +1238,7 @@ haiku_get_pixel (haiku bitmap, int x, int y)
|
|||
BBitmap_dimensions (bitmap, &left, &top, &right, &bottom,
|
||||
&bytes_per_row, &mono_p);
|
||||
|
||||
if (x < left || x > right || y < top || y > bottom)
|
||||
if (x < 0 || x > right - left || y < 0 || y > bottom - top)
|
||||
emacs_abort ();
|
||||
|
||||
if (!mono_p)
|
||||
|
@ -1263,7 +1263,7 @@ haiku_put_pixel (haiku bitmap, int x, int y, unsigned long pixel)
|
|||
BBitmap_dimensions (bitmap, &left, &top, &right, &bottom,
|
||||
&bytes_per_row, &mono_p);
|
||||
|
||||
if (x < left || x > right || y < top || y > bottom)
|
||||
if (x < 0 || x > right - left || y < 0 || y > bottom - top)
|
||||
emacs_abort ();
|
||||
|
||||
if (mono_p)
|
||||
|
|
Loading…
Add table
Reference in a new issue