diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c index 5fac100897..d73c24df83 100644 --- a/libavcodec/screenpresso.c +++ b/libavcodec/screenpresso.c @@ -94,8 +94,9 @@ static void sum_delta_flipped(uint8_t *dst, int dst_linesize, { int i; for (; height > 0; height--) { + const uint8_t *src1 = &src[(height - 1) * src_linesize]; for (i = 0; i < bytewidth; i++) - dst[i] += src[(height - 1) * src_linesize + i]; + dst[i] += src1[i]; dst += dst_linesize; } }