diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 11:44:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-19 09:37:29 +0200 |
commit | abd13678a02a39110c6eef5ad55dcb97fce62ade (patch) | |
tree | 4d7e4939952e7d3d8130647eb304d710ee74c784 /vcl/source | |
parent | 8634bbde836c15db7e8e88372a1d5329e08a1406 (diff) |
cid#1448308 Unintended sign extension
Change-Id: I3d89afa66dc42144f0717c34593d48c4869aeec4
Reviewed-on: https://gerrit.libreoffice.org/75923
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/bitmap/BitmapScaleSuperFilter.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx index b621ebe95fa7..7f7d5bffdd3c 100644 --- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx @@ -395,10 +395,10 @@ void scaleDown32bit(ScaleContext &rCtx, long nStartY, long nEndY) 1 : (rCtx.maMapIX[nRight] - rCtx.maMapIX[nLeft]); } - long nSum1 = 0; - long nSum2 = 0; - long nSum3 = 0; - long nSum4 = 0; + int nSum1 = 0; + int nSum2 = 0; + int nSum3 = 0; + int nSum4 = 0; BilinearWeightType nTotalWeightY = 0; for (long i = 0; i<= nLineRange; i++) @@ -406,10 +406,10 @@ void scaleDown32bit(ScaleContext &rCtx, long nStartY, long nEndY) Scanline pTmpY = rCtx.mpSrc->GetScanline(nLineStart + i); Scanline pTmpX = pTmpY + constColorComponents * nRowStart; - long nSumRow1 = 0; - long nSumRow2 = 0; - long nSumRow3 = 0; - long nSumRow4 = 0; + int nSumRow1 = 0; + int nSumRow2 = 0; + int nSumRow3 = 0; + int nSumRow4 = 0; BilinearWeightType nTotalWeightX = 0; for (long j = 0; j <= nRowRange; j++) @@ -531,17 +531,17 @@ void scaleDownPalette8bit(ScaleContext &rCtx, long nStartY, long nEndY) nRowRange = ( rCtx.maMapIX[ nRight ] == rCtx.maMapIX[ nLeft ] )? 1 : ( rCtx.maMapIX[ nRight ] - rCtx.maMapIX[ nLeft ] ); } - long nSumR = 0; - long nSumG = 0; - long nSumB = 0; + int nSumR = 0; + int nSumG = 0; + int nSumB = 0; BilinearWeightType nTotalWeightY = 0; for(long i = 0; i<= nLineRange; i++) { Scanline pTmpY = rCtx.mpSrc->GetScanline( nLineStart + i ); - long nSumRowR = 0; - long nSumRowG = 0; - long nSumRowB = 0; + int nSumRowR = 0; + int nSumRowG = 0; + int nSumRowB = 0; BilinearWeightType nTotalWeightX = 0; for(long j = 0; j <= nRowRange; j++) @@ -655,16 +655,16 @@ void scaleDownPaletteGeneral(ScaleContext &rCtx, long nStartY, long nEndY) nRowRange = ( rCtx.maMapIX[ nRight ] == rCtx.maMapIX[ nLeft ] )? 1 : ( rCtx.maMapIX[ nRight ] - rCtx.maMapIX[ nLeft ] ); } - long nSumR = 0; - long nSumG = 0; - long nSumB = 0; + int nSumR = 0; + int nSumG = 0; + int nSumB = 0; BilinearWeightType nTotalWeightY = 0; for(long i = 0; i<= nLineRange; i++) { - long nSumRowR = 0; - long nSumRowG = 0; - long nSumRowB = 0; + int nSumRowR = 0; + int nSumRowG = 0; + int nSumRowB = 0; BilinearWeightType nTotalWeightX = 0; Scanline pScanlineSrc = rCtx.mpSrc->GetScanline( nLineStart + i ); @@ -915,16 +915,16 @@ void scaleDownNonPaletteGeneral(ScaleContext &rCtx, long nStartY, long nEndY) nRowRange = ( rCtx.maMapIX[ nRight ] == rCtx.maMapIX[ nLeft ] )? 1 : ( rCtx.maMapIX[ nRight ] - rCtx.maMapIX[ nLeft ] ); } - long nSumR = 0; - long nSumG = 0; - long nSumB = 0; + int nSumR = 0; + int nSumG = 0; + int nSumB = 0; BilinearWeightType nTotalWeightY = 0; for(long i = 0; i<= nLineRange; i++) { - long nSumRowR = 0; - long nSumRowG = 0; - long nSumRowB = 0; + int nSumRowR = 0; + int nSumRowG = 0; + int nSumRowB = 0; BilinearWeightType nTotalWeightX = 0; Scanline pScanlineSrc = rCtx.mpSrc->GetScanline( nLineStart + i ); |