coverity#1222230 Division or modulo by zero
Change-Id: I98ccd214be79f3d95c023fd5134d09c1cff3ee32
This commit is contained in:
@@ -378,9 +378,14 @@ void scalePallete8bit2(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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user