mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-24 10:24:36 +03:00
Fix line plotting and rectangle clipping segfault
svn path=/trunk/netsurf/; revision=5430
This commit is contained in:
parent
9b76a47bbe
commit
29d1e44dec
@ -66,7 +66,8 @@ static bool fb_16bpp_line(int x0, int y0, int x1, int y1, int width,
|
||||
|
||||
if (y0 == y1) {
|
||||
/* horizontal line special cased */
|
||||
fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1);
|
||||
if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
|
||||
return true; /* line outside clipping */
|
||||
|
||||
/*LOG(("horiz: %d, %d, %d, %d, %d, 0x%lx, %d, %d",
|
||||
x0,y0,x1,y1,width,c,dotted,dashed));*/
|
||||
|
@ -60,7 +60,8 @@ static bool fb_32bpp_line(int x0, int y0, int x1, int y1, int width,
|
||||
|
||||
if (y0 == y1) {
|
||||
/* horizontal line special cased */
|
||||
fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1);
|
||||
if (!fb_plotters_clip_rect_ctx(&x0, &y0, &x1, &y1))
|
||||
return true; /* line outside clipping */
|
||||
|
||||
pvideo = fb_32bpp_get_xy_loc(x0, y0);
|
||||
|
||||
|
@ -61,8 +61,8 @@ bool fb_plotters_clip_rect(const bbox_t *clip,
|
||||
|
||||
if (*y1 < *y0) SWAP(*y0, *y1);
|
||||
|
||||
region1 = REGION(*x0, *y0, clip->x0, clip->x1, clip->y0, clip->y1);
|
||||
region2 = REGION(*x1, *y1, clip->x0, clip->x1, clip->y0, clip->y1);
|
||||
region1 = REGION(*x0, *y0, clip->x0, clip->x1 - 1, clip->y0, clip->y1 - 1);
|
||||
region2 = REGION(*x1, *y1, clip->x0, clip->x1 - 1, clip->y0, clip->y1 - 1);
|
||||
|
||||
/* area lies entirely outside the clipping rectangle */
|
||||
if ((region1 | region2) && (region1 & region2))
|
||||
|
Loading…
x
Reference in New Issue
Block a user