coverity#1222226 Division or modulo by zero
Change-Id: I45cbb8dbf2b9e7be6e8dda8603c2ef5f88507d04
This commit is contained in:
@@ -648,9 +648,13 @@ void scale24bitBGR2(BitmapReadAccess* pAcc, BitmapWriteAccess* pWAcc,
|
||||
nTotalWeightY += nWeightY;
|
||||
}
|
||||
|
||||
BitmapColor aColRes( ( sal_uInt8 ) (( nSumR / nTotalWeightY ) ),
|
||||
( sal_uInt8 ) (( nSumG / nTotalWeightY) ),
|
||||
( sal_uInt8 ) (( nSumB / nTotalWeightY) ));
|
||||
if (nTotalWeightY)
|
||||
{
|
||||
nSumR /= nTotalWeightY;
|
||||
nSumG /= nTotalWeightY;
|
||||
nSumB /= nTotalWeightY;
|
||||
}
|
||||
BitmapColor aColRes((sal_uInt8)nSumR, (sal_uInt8)nSumG, (sal_uInt8)nSumB);
|
||||
pWAcc->SetPixel( nYDst, nXDst++, aColRes );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user