Module: libav
Branch: release/0.8
Commit: 7f33a24e824c6d20cb941e6b20c5382becfbc923

Author:    Anton Khirnov <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Thu Nov 28 10:54:35 2013 +0100

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

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:[email protected]

---

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

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

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to