From e038ecf7076746752d76f4049968eae646dd830c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 21 Apr 2020 00:03:39 +0200 Subject: [PATCH] avcodec/iff: Fix invalid pointer intermediates in decode_deep_rle32() Reviewed-by: Peter Ross Signed-off-by: Michael Niedermayer (cherry picked from commit bc41a29a5aa3c3dedba0a85b4aeb79a07eeeb1b4) Signed-off-by: Michael Niedermayer --- libavcodec/iff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 72e3ae73b2..76ad63d102 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -715,7 +715,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) {