Fix segfaults when processing very large files in queue, #5170

This commit is contained in:
heckflosse
2019-02-13 00:38:11 +01:00
parent 2d167d923b
commit 8eba1c40a6
3 changed files with 13 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ void LabImage::getPipetteData (float &v1, float &v2, float &v3, int posX, int po
v3 = n ? accumulator_b / float(n) : 0.f;
}
void LabImage::allocLab(int w, int h)
void LabImage::allocLab(size_t w, size_t h)
{
L = new float*[h];
a = new float*[h];
@@ -73,19 +73,19 @@ void LabImage::allocLab(int w, int h)
data = new float [w * h * 3];
float * index = data;
for (int i = 0; i < h; i++) {
for (size_t i = 0; i < h; i++) {
L[i] = index + i * w;
}
index += w * h;
for (int i = 0; i < h; i++) {
for (size_t i = 0; i < h; i++) {
a[i] = index + i * w;
}
index += w * h;
for (int i = 0; i < h; i++) {
for (size_t i = 0; i < h; i++) {
b[i] = index + i * w;
}
}