coverity#1222226 Division or modulo by zero

Change-Id: I45cbb8dbf2b9e7be6e8dda8603c2ef5f88507d04
This commit is contained in:
Caolán McNamara
2014-06-10 13:50:46 +01:00
parent 2fbacba254
commit 10eceebd22

View File

@@ -648,9 +648,13 @@ void scale24bitBGR2(BitmapReadAccess* pAcc, BitmapWriteAccess* pWAcc,
nTotalWeightY += nWeightY; nTotalWeightY += nWeightY;
} }
BitmapColor aColRes( ( sal_uInt8 ) (( nSumR / nTotalWeightY ) ), if (nTotalWeightY)
( sal_uInt8 ) (( nSumG / nTotalWeightY) ), {
( sal_uInt8 ) (( nSumB / nTotalWeightY) )); nSumR /= nTotalWeightY;
nSumG /= nTotalWeightY;
nSumB /= nTotalWeightY;
}
BitmapColor aColRes((sal_uInt8)nSumR, (sal_uInt8)nSumG, (sal_uInt8)nSumB);
pWAcc->SetPixel( nYDst, nXDst++, aColRes ); pWAcc->SetPixel( nYDst, nXDst++, aColRes );
} }
} }