Fix wrong condition which leads to uninitialized memory access for xtrans files, fixes #3156
This commit is contained in:
parent
583dd8ea8c
commit
904467b5a3
@ -88,17 +88,17 @@ void RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblac
|
||||
float val;
|
||||
double dsum[8], dmin, dmax;
|
||||
|
||||
if ((this->get_cblack(4) + 1) / 2 == 1 && (this->get_cblack(5) + 1) / 2 == 1) {
|
||||
for (int c = 0; c < 4; c++) {
|
||||
cblack_[FC(c / 2, c % 2)] = this->get_cblack(6 + c / 2 % this->get_cblack(4) * this->get_cblack(5) + c % 2 % this->get_cblack(5));
|
||||
pre_mul_[c] = this->get_pre_mul(c);
|
||||
}
|
||||
} else if(isXtrans()) {
|
||||
if(isXtrans()) {
|
||||
// for xtrans files dcraw stores black levels in cblack[6] .. cblack[41], but all are equal, so we just use cblack[6]
|
||||
for (int c = 0; c < 4; c++) {
|
||||
cblack_[c] = (float) this->get_cblack(6);
|
||||
pre_mul_[c] = this->get_pre_mul(c);
|
||||
}
|
||||
} else if ((this->get_cblack(4) + 1) / 2 == 1 && (this->get_cblack(5) + 1) / 2 == 1) {
|
||||
for (int c = 0; c < 4; c++) {
|
||||
cblack_[FC(c / 2, c % 2)] = this->get_cblack(6 + c / 2 % this->get_cblack(4) * this->get_cblack(5) + c % 2 % this->get_cblack(5));
|
||||
pre_mul_[c] = this->get_pre_mul(c);
|
||||
}
|
||||
} else {
|
||||
for (int c = 0; c < 4; c++) {
|
||||
cblack_[c] = (float) this->get_cblack(c);
|
||||
|
Loading…
x
Reference in New Issue
Block a user