mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix clang-analyzer-core.uninitialized.Assign
/media/ddnet/src/engine/shared/dilate.cpp:32:22: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
This commit is contained in:
parent
87b06d307f
commit
7f38bc0941
|
@ -29,7 +29,10 @@ static void Dilate(int w, int h, int BPP, unsigned char *pSrc, unsigned char *pD
|
|||
if(pSrc[k + AlphaCompIndex] > AlphaThreshold)
|
||||
{
|
||||
for(int p = 0; p < BPP - 1; ++p)
|
||||
SumOfOpaque[p] += pSrc[k + p];
|
||||
// Seems safe for BPP = 3, 4 which we use. clang-analyzer seems to
|
||||
// asssume being called with larger value. TODO: Can make this
|
||||
// safer anyway.
|
||||
SumOfOpaque[p] += pSrc[k + p]; // NOLINT(clang-analyzer-core.uninitialized.Assign)
|
||||
++Counter;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue