Fix "fl_draw_image() with horizontal flip reads out of bounds" (#1369)
This commit is contained in:
parent
d9a3fb32da
commit
b67d4ef2dd
@ -480,7 +480,7 @@ void Fl_Graphics_Driver::draw_image_general_(const uchar *buf, int X, int Y, int
|
||||
data.buf = buf;
|
||||
data.D_in = d_corrected;
|
||||
data.D_out = d_out;
|
||||
data.L = (L ? L : W * d_corrected);
|
||||
data.L = (L ? L : W * abs(d_corrected));
|
||||
if (alpha) d_out |= FL_IMAGE_WITH_ALPHA;
|
||||
fl_graphics_driver->draw_image((Fl_Draw_Image_Cb)scan_cb, &data, X, Y, W, H, d_out);
|
||||
} else
|
||||
|
||||
@ -105,7 +105,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
}
|
||||
|
||||
void Fl_Quartz_Graphics_Driver::draw_image(const uchar* buf, int x, int y, int w, int h, int d, int l){
|
||||
d &= ~FL_IMAGE_WITH_ALPHA;
|
||||
if (d > 0) d &= ~FL_IMAGE_WITH_ALPHA;
|
||||
else if (!(d & FL_IMAGE_WITH_ALPHA)) d |= FL_IMAGE_WITH_ALPHA;
|
||||
innards(buf,x,y,w,h,d,l,(d<3&&d>-3),0,0,gc_,this);
|
||||
}
|
||||
void Fl_Quartz_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user