Ticket #10370: 0006-Fix-mismatching-allocation-and-deallocation.patch

File 0006-Fix-mismatching-allocation-and-deallocation.patch, 1.3 KB (added by mt, 7 years ago)

Patch

  • src/add-ons/translators/psd/PSDLoader.cpp

    From e73226ee06ded495a413f7273af3e7374e004c32 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Fri, 3 Jan 2014 19:28:40 +0900
    Subject: [PATCH 6/7] Fix mismatching allocation and deallocation
    
    ---
     src/add-ons/translators/psd/PSDLoader.cpp |   10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/src/add-ons/translators/psd/PSDLoader.cpp b/src/add-ons/translators/psd/PSDLoader.cpp
    index 2afc4ac..1cdd19d 100644
    a b PSDLoader::Decode(BPositionIO *target)  
    250250            break;
    251251        }
    252252        default:
    253             delete fStreamBuffer;
     253            delete[] fStreamBuffer;
    254254            for (int i = 0; i < fChannels; i++)
    255                 delete imageData[i];
     255                delete[] imageData[i];
    256256            return  B_NO_TRANSLATOR;
    257257    }
    258258
    259     delete fStreamBuffer;
     259    delete[] fStreamBuffer;
    260260
    261261    TranslatorBitmap bitsHeader;
    262262    bitsHeader.magic = B_TRANSLATOR_BITMAP;
    PSDLoader::Decode(BPositionIO *target)  
    324324                }
    325325                target->Write(lineData, fWidth * sizeof(uint32));
    326326            }
    327             delete colorData;
     327            delete[] colorData;
    328328            break;
    329329        }
    330330        case PSD_COLOR_FORMAT_DUOTONE:
    PSDLoader::Decode(BPositionIO *target)  
    452452            break;
    453453    };
    454454
    455     delete lineData;
     455    delete[] lineData;
    456456    for (int i = 0; i < fChannels; i++)
    457457        delete imageData[i];
    458458