[libav-stable] rpza: limit the number of blocks to the total remaining blocks in the frame

Anton Khirnov git at libav.org
Mon Feb 10 15:27:53 CET 2014


Module: libav
Branch: master
Commit: 77bb0004bbe18f1498cfecdc68db5f10808b6599

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Thu Nov 28 10:54:35 2013 +0100

rpza: limit the number of blocks to the total remaining blocks in the frame

Fixes invalid writes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org

---

 libavcodec/rpza.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 0efd7f4..83dde7a 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -119,6 +119,8 @@ static void rpza_decode_stream(RpzaContext *s)
             }
         }
 
+        n_blocks = FFMIN(n_blocks, total_blocks);
+
         switch (opcode & 0xe0) {
 
         /* Skip blocks */



More information about the libav-stable mailing list