Commit e28a1d49 authored by michael's avatar michael

Move "slice below image" check from mpeg_decode_slice to its caller.

Should fix issue1277.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20676 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 099610fd
...@@ -1673,10 +1673,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, ...@@ -1673,10 +1673,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
s->resync_mb_x= s->resync_mb_x=
s->resync_mb_y= -1; s->resync_mb_y= -1;
if (mb_y >= s->mb_height){ assert(mb_y < s->mb_height);
av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height);
return -1;
}
init_get_bits(&s->gb, *buf, buf_size*8); init_get_bits(&s->gb, *buf, buf_size*8);
...@@ -2390,6 +2387,11 @@ static int decode_chunks(AVCodecContext *avctx, ...@@ -2390,6 +2387,11 @@ static int decode_chunks(AVCodecContext *avctx,
if(s2->picture_structure == PICT_BOTTOM_FIELD) if(s2->picture_structure == PICT_BOTTOM_FIELD)
mb_y++; mb_y++;
if (mb_y >= s2->mb_height){
av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height);
return -1;
}
if(s2->last_picture_ptr==NULL){ if(s2->last_picture_ptr==NULL){
/* Skip B-frames if we do not have reference frames and gop is not closed */ /* Skip B-frames if we do not have reference frames and gop is not closed */
if(s2->pict_type==FF_B_TYPE){ if(s2->pict_type==FF_B_TYPE){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment