Commit f2c269b5 authored by Lukáš Tvrdý's avatar Lukáš Tvrdý

Fix memory leak in psd format filter

readPlanarBytes returns QVector of pointers to allocated arrays
and caller is responsible for clean-up of memory

REVIEW:110214
parent 22fadec3
......@@ -259,6 +259,9 @@ bool PSDImageData::write(QIODevice *io, KisPaintDeviceSP dev)
}
}
qDeleteAll(planes);
planes.clear();
return true;
}
......
......@@ -647,6 +647,8 @@ bool PSDLayerRecord::writePixelData(QIODevice *io)
}
}
// now planes are holding pointers to quint8 arrays
tmp.clear();
// here's where we save the total size of the channel data
for (int channelInfoIndex = 0; channelInfoIndex < nChannels; ++channelInfoIndex) {
......@@ -739,6 +741,9 @@ bool PSDLayerRecord::writePixelData(QIODevice *io)
io->seek(currentPos);
}
qDeleteAll(planes);
planes.clear();
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment