[FFmpeg-devel] [PATCH 10/16] qtrle: check for invalid line offset

fenrir at elivagar.org fenrir at elivagar.org
Sat Oct 8 23:40:35 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

---
 libavcodec/qtrle.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 752bbc1..bd9514a 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -464,6 +464,10 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
         stream_ptr += 4;
         height = AV_RB16(&s->buf[stream_ptr]);
         stream_ptr += 4;
+        if (start_line >= s->avctx->height ||
+            start_line + height > s->avctx->height)
+            goto done;
+
     } else {
         start_line = 0;
         height = s->avctx->height;
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list