diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index 55ce5e18a1..c8480e74dd 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -196,7 +196,7 @@ static int block_contrast(uint8_t *src, int x, int y, int stride, int blocksize) for (i = 0; i <= blocksize * 2; i++) { // We use a width of 16 here to match the sad function for (j = 0; j <= 15; j++) { - pos = (y - i) * stride + (x - j); + pos = (y + i) * stride + (x + j); if (src[pos] < lowest) lowest = src[pos]; else if (src[pos] > highest) {