[FFmpeg-cvslog] h264: check that execute_decode_slices() is not called too many times

Anton Khirnov git at videolan.org
Mon Jan 6 16:45:30 CET 2014


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

h264: check that execute_decode_slices() is not called too many times

Fixes invalid reads.

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=9eef9eb3014b2ed9c3ff4aac510a9f04edb555cf
---

 libavcodec/h264.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c0dfa3d..7d49d48 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4495,6 +4495,12 @@ static int execute_decode_slices(H264Context *h, int context_count)
     H264Context *hx;
     int i;
 
+    if (h->mb_y >= h->mb_height) {
+        av_log(h->avctx, AV_LOG_ERROR,
+               "Input contains more MB rows than the frame height.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (h->avctx->hwaccel)
         return 0;
     if (context_count == 1) {



More information about the ffmpeg-cvslog mailing list