diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index 5b59dbd5dc..abfbd1d76c 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -81,6 +81,14 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i break; case 3: case 4: + while (len >= 4) { + total += src[0] + src[1 ] + src[2 ] + + src[ stride] + src[1+ stride] + src[2+ stride]; + + src[2*stride] + src[1+2*stride] + src[2+2*stride]; + + src[3*stride] + src[1+3*stride] + src[2+3*stride]; + src += 4*stride; + len -= 4; + } while (--len >= 0) { total += src[0] + src[1] + src[2]; src += stride;