Fix: fl_draw_image() with horizontal flip reads out of bounds (#1112)

This commit is contained in:
ManoloFLTK 2024-11-08 10:28:27 +01:00
parent 3fbbce0654
commit e15cd9d5bb

View File

@ -667,7 +667,6 @@ void Fl_Cairo_Graphics_Driver::draw_image_mono(const uchar *data, int ix, int iy
struct callback_data cb_data; struct callback_data cb_data;
const size_t aD = abs(D); const size_t aD = abs(D);
if (!LD) LD = iw * aD; if (!LD) LD = iw * aD;
if (D<0) data += iw * aD;
cb_data.data = data; cb_data.data = data;
cb_data.D = D; cb_data.D = D;
cb_data.LD = LD; cb_data.LD = LD;
@ -740,7 +739,6 @@ void Fl_Cairo_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int
} }
struct callback_data cb_data; struct callback_data cb_data;
if (!LD) LD = iw*abs(D); if (!LD) LD = iw*abs(D);
if (D<0) data += iw*abs(D);
cb_data.data = data; cb_data.data = data;
cb_data.D = D; cb_data.D = D;
cb_data.LD = LD; cb_data.LD = LD;