Kaydet (Commit) da62285f authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1222232 Division or modulo by zero

Change-Id: I4a3921df8e6510a37702ae8bd4856ba43c98213a
üst aaaf2432
......@@ -502,9 +502,14 @@ void scalePalleteGeneral2(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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment