diff --git a/libavformat/vividas.c b/libavformat/vividas.c index dc446929c3..ecbe47765c 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -129,11 +129,12 @@ static void xor_block(void *p1, void *p2, unsigned size, int key, unsigned *key_ size >>= 2; - while (size--) { + while (size > 0) { *d2 = *d1 ^ k; k += key; d1++; d2++; + size--; } *key_ptr = k;