libpostproc: fix out of array accesses detected by AddressSanitizer.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Feb 2012 03:25:13 +0000 (04:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Feb 2012 03:25:13 +0000 (04:25 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libpostproc/postprocess_template.c

index 4b8184c..3419257 100644 (file)
@@ -3549,7 +3549,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
                 {
                     RENAME(tempNoiseReducer)(dstBlock-8, stride,
                             c.tempBlurred[isColor] + y*dstStride + x,
-                            c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3),
+                            c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256,
                             c.ppMode.maxTmpNoise);
                 }
             }
@@ -3571,7 +3571,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
         if((mode & TEMP_NOISE_FILTER)){
             RENAME(tempNoiseReducer)(dstBlock-8, dstStride,
                     c.tempBlurred[isColor] + y*dstStride + x,
-                    c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3),
+                    c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3) + 256,
                     c.ppMode.maxTmpNoise);
         }