Commit 87aaf248 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix invalid access in color sampling

code duplication is evil...
parent 7167998b
...@@ -164,8 +164,8 @@ void sampleColor(const QRect &srcRect, ...@@ -164,8 +164,8 @@ void sampleColor(const QRect &srcRect,
while (numSamplesLeft > 0) { while (numSamplesLeft > 0) {
const int currentBatchSize = qMin(numSamplesLeft, batchSize); const int currentBatchSize = qMin(numSamplesLeft, batchSize);
for (int i = 0; i < currentBatchSize; i++) { for (int i = 0; i < currentBatchSize; i++) {
const QPoint pt(hGen.generate(sampleRect.width()), const QPoint pt(hGen.generate(sampleRect.width() - 1),
vGen.generate(sampleRect.height())); vGen.generate(sampleRect.height() - 1));
weightingModeWrapper.samplePixel(pt); weightingModeWrapper.samplePixel(pt);
} }
......
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