Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 1e513a17 authored by Dmitry Kazakov's avatar Dmitry Kazakov

We should initialize KoColor object before picking data into it

Otherwise memory overflow happens and we start reading/writing weird
uninitialized memory chunks.

parent c72acfe6
......@@ -35,14 +35,12 @@ namespace KisToolUtils {
bool pick(KisPaintDeviceSP dev, const QPoint& pos, KoColor *color, int radius)
KoColor pickedColor;
const KoColorSpace* cs = dev->colorSpace();
KoColor pickedColor(Qt::transparent, cs);
if (radius <= 1) {
dev->pixel(pos.x(), pos.y(), &pickedColor);
} else {
const KoColorSpace* cs = dev->colorSpace();
pickedColor = KoColor(Qt::transparent, cs);
QVector<const quint8*> pixels;
const int effectiveRadius = radius - 1;
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