Mercurial > libavcodec.hg
comparison mpeg12.c @ 10607:6e672d7eb297 libavcodec
Move "slice below image" check from mpeg_decode_slice to its caller.
Should fix issue1277.
author | michael |
---|---|
date | Mon, 30 Nov 2009 23:08:25 +0000 |
parents | 9ea5f2f1874f |
children | cf7af348a11a |
comparison
equal
deleted
inserted
replaced
10606:9ea5f2f1874f | 10607:6e672d7eb297 |
---|---|
1671 const int lowres= s->avctx->lowres; | 1671 const int lowres= s->avctx->lowres; |
1672 | 1672 |
1673 s->resync_mb_x= | 1673 s->resync_mb_x= |
1674 s->resync_mb_y= -1; | 1674 s->resync_mb_y= -1; |
1675 | 1675 |
1676 if (mb_y >= s->mb_height){ | 1676 assert(mb_y < s->mb_height); |
1677 av_log(s->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s->mb_height); | |
1678 return -1; | |
1679 } | |
1680 | 1677 |
1681 init_get_bits(&s->gb, *buf, buf_size*8); | 1678 init_get_bits(&s->gb, *buf, buf_size*8); |
1682 | 1679 |
1683 ff_mpeg1_clean_buffers(s); | 1680 ff_mpeg1_clean_buffers(s); |
1684 s->interlaced_dct = 0; | 1681 s->interlaced_dct = 0; |
2388 last_code= SLICE_MIN_START_CODE; | 2385 last_code= SLICE_MIN_START_CODE; |
2389 | 2386 |
2390 if(s2->picture_structure == PICT_BOTTOM_FIELD) | 2387 if(s2->picture_structure == PICT_BOTTOM_FIELD) |
2391 mb_y++; | 2388 mb_y++; |
2392 | 2389 |
2390 if (mb_y >= s2->mb_height){ | |
2391 av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height); | |
2392 return -1; | |
2393 } | |
2394 | |
2393 if(s2->last_picture_ptr==NULL){ | 2395 if(s2->last_picture_ptr==NULL){ |
2394 /* Skip B-frames if we do not have reference frames and gop is not closed */ | 2396 /* Skip B-frames if we do not have reference frames and gop is not closed */ |
2395 if(s2->pict_type==FF_B_TYPE){ | 2397 if(s2->pict_type==FF_B_TYPE){ |
2396 if(!s2->closed_gop) | 2398 if(!s2->closed_gop) |
2397 break; | 2399 break; |