avcodec/iff: Fix invalid pointer intermediates in decode_deep_rle32()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Apr 2020 22:03:39 +0000 (00:03 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 22 Apr 2020 20:57:38 +0000 (22:57 +0200)
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/iff.c

index acd6519..2e65e26 100644 (file)
@@ -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) {