From kde-commits Tue Aug 31 20:44:23 2004 From: Cyrille Berger Date: Tue, 31 Aug 2004 20:44:23 +0000 To: kde-commits Subject: koffice/krita/core Message-Id: <20040831204423.F00E09350 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109398509601270 CVS commit by berger: * fix the copyright header of kis_convolution_painter.* * correct a memory overflow in KisConvolutionPainter::applyConvolutionColorTransformation M +7 -7 kis_convolution_painter.cc 1.2 M +1 -1 kis_convolution_painter.h 1.4 --- koffice/krita/core/kis_convolution_painter.cc #1.1:1.2 @@ -1,4 +1,4 @@ /* - * Copyright (c) 2004 Adrian Page + * Copyright (c) 2004 Cyrille Berger * * This program is free software; you can redistribute it and/or modify @@ -128,5 +128,5 @@ void KisConvolutionPainter::applyConvolu currentPixel = curIt; ++curIt; - memmove( pixels, pixels + 1, 9 * sizeof(KisPixelRepresentationReadOnly)); + memmove( pixels, pixels + 1, 8 * sizeof(KisPixelRepresentationReadOnly)); pixels[ CONVOLUTION_PIXEL_RIGHT ] = curIt.oldValue(); pixels[ CONVOLUTION_PIXEL_RIGHTBOTTOM ] = afterIt.oldValue(); @@ -202,5 +202,5 @@ void KisConvolutionPainter::applyConvolu currentPixel = curIt; ++curIt; - memmove( pixels, pixels + 1, 9 * sizeof(KisPixelRepresentationReadOnly)); + memmove( pixels, pixels + 1, 8 * sizeof(KisPixelRepresentationReadOnly)); pixels[ CONVOLUTION_PIXEL_RIGHTTOP ] = beforeIt.oldValue(); ++beforeIt; @@ -272,5 +272,5 @@ void KisConvolutionPainter::applyConvolu currentPixel = curIt; ++curIt; - memmove( pixels, pixels + 1, 9 * sizeof(KisPixelRepresentationReadOnly)); + memmove( pixels, pixels + 1, 8 * sizeof(KisPixelRepresentationReadOnly)); pixels[ CONVOLUTION_PIXEL_RIGHTTOP ] = beforeIt.oldValue(); ++beforeIt; @@ -294,7 +294,7 @@ void KisConvolutionPainter::applyConvolu sum = (sum == 0) ? 1 : sum; currentPixel[ i ] = QMAX( 0, QMIN( QUANTUM_MAX, ( currentPixel[ i ] * matrix[i][1][1] - + pixels[ CONVOLUTION_PIXEL_BOTTOM - 1 ][i] * matrix[i][0][0] - + pixels[ CONVOLUTION_PIXEL_RIGHTBOTTOM - 1 ][i] * matrix[i][0][1] - + pixels[ CONVOLUTION_PIXEL_RIGHT - 1 ][i] * matrix[i][1][0] ) * matrix[i].sum() + + pixels[ CONVOLUTION_PIXEL_LEFTTOP + 1 ][i] * matrix[i][0][0] + + pixels[ CONVOLUTION_PIXEL_TOP + 1 ][i] * matrix[i][0][1] + + pixels[ CONVOLUTION_PIXEL_LEFT + 1 ][i] * matrix[i][1][0] ) * matrix[i].sum() / matrix[i].factor() / sum + matrix[i].offset() ) ); } --- koffice/krita/core/kis_convolution_painter.h #1.3:1.4 @@ -1,4 +1,4 @@ /* - * Copyright (c) 2004 Adrian Page + * Copyright (c) 2004 Cyrille Berger * * This program is free software; you can redistribute it and/or modify