From 6b53b87e20a4fc399df7e1936769a3969a901cfc Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Mon, 27 Jun 2005 23:13:10 +0000
Subject: [PATCH] check mb_y

Originally committed as revision 4401 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/h264.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 9517f3cc710..f17c592df69 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4241,6 +4241,9 @@ static int decode_slice_header(H264Context *h){
 
     s->resync_mb_x = s->mb_x = first_mb_in_slice % s->mb_width;
     s->resync_mb_y = s->mb_y = first_mb_in_slice / s->mb_width;
+    if(s->mb_y >= s->mb_height){
+        return -1;
+    }
     
     if(s->picture_structure==PICT_FRAME){
         h->curr_pic_num=   h->frame_num;
-- 
GitLab