Ticket #46317: patch-dimg-rotate.diff

File patch-dimg-rotate.diff, 835 bytes (added by RJVB (René Bertin), 9 years ago)

This patch corrects a bug in the rotate-180° algorithm, causing a crash on OS X

  • core/libs/dimg/dimg.cpp

    diff --git a/core/libs/dimg/dimg.cpp b/core/libs/dimg/dimg.cpp
    index 4a99e75..941f8ed 100644
    a b void DImg::rotate(ANGLE angle) 
    23552355                for (uint y = 0; y < ymax; ++y)
    23562356                {
    23572357                    line1 = data + y * w;
    2358                     line2 = data + (h - y) * w;
     2358                    line2 = data + (h - y) * w - 1;
    23592359
    23602360                    for (uint x = 0; x < w; ++x)
    23612361                    {
    void DImg::rotate(ANGLE angle) 
    23872387                for (uint y = 0; y < ymax; ++y)
    23882388                {
    23892389                    line1 = data + y * w;
    2390                     line2 = data + (h - y) * w;
     2390                    line2 = data + (h - y) * w - 1;
    23912391
    23922392                    for (uint x = 0; x < w; ++x)
    23932393                    {