diff --git a/src/training/degradeimage.cpp b/src/training/degradeimage.cpp index 3ab57f9bf5..48db94aa2f 100644 --- a/src/training/degradeimage.cpp +++ b/src/training/degradeimage.cpp @@ -166,7 +166,7 @@ Image DegradeImage(Image input, int exposure, TRand *randomizer, float *rotation } SET_DATA_BYTE(data, x, pixel); } - data += input->wpl; + data += pixGetWpl(input); } return input; } diff --git a/src/training/pango/stringrenderer.cpp b/src/training/pango/stringrenderer.cpp index cce4ac3a33..b3f9a58d4f 100644 --- a/src/training/pango/stringrenderer.cpp +++ b/src/training/pango/stringrenderer.cpp @@ -85,7 +85,7 @@ static Image CairoARGB32ToPixFormat(cairo_surface_t *surface) { int byte_stride = cairo_image_surface_get_stride(surface); for (int i = 0; i < height; ++i) { - memcpy(reinterpret_cast(pix->data + i * pix->wpl) + 1, + memcpy(reinterpret_cast(pixGetData(pix) + i * pixGetWpl(pix)) + 1, cairo_image_surface_get_data(surface) + i * byte_stride, byte_stride - ((i == height - 1) ? 1 : 0)); }