[FFmpeg-cvslog] rpza: limit the number of blocks to the total remaining blocks in the frame

Anton Khirnov git at videolan.org
Mon Feb 10 21:38:28 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Nov 28 10:54:35 2013 +0100| [77bb0004bbe18f1498cfecdc68db5f10808b6599] | committer: Anton Khirnov

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77bb0004bbe18f1498cfecdc68db5f10808b6599
---

 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 ffmpeg-cvslog mailing list