diff --git a/libavcodec/iff.c b/libavcodec/iff.c index e5a75bd617..7f8f868ba9 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -590,7 +590,7 @@ static void decode_deep_rle32(uint8_t *dst, const uint8_t *src, int src_size, in { const uint8_t *src_end = src + src_size; int x = 0, y = 0, i; - while (src + 5 <= src_end) { + while (src_end - src >= 5) { int opcode; opcode = *(int8_t *)src++; if (opcode >= 0) {