mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
Fix "fl_draw_image() with horizontal flip reads out of bounds" (#1369)
This commit is contained in:
@@ -480,7 +480,7 @@ void Fl_Graphics_Driver::draw_image_general_(const uchar *buf, int X, int Y, int
|
|||||||
data.buf = buf;
|
data.buf = buf;
|
||||||
data.D_in = d_corrected;
|
data.D_in = d_corrected;
|
||||||
data.D_out = d_out;
|
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;
|
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);
|
fl_graphics_driver->draw_image((Fl_Draw_Image_Cb)scan_cb, &data, X, Y, W, H, d_out);
|
||||||
} else
|
} 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){
|
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);
|
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,
|
void Fl_Quartz_Graphics_Driver::draw_image(Fl_Draw_Image_Cb cb, void* data,
|
||||||
|
|||||||
Reference in New Issue
Block a user