# HG changeset patch # User michael # Date 1259449506 0 # Node ID 8aff2b05e9781a0d714e2837b78c0031407e6395 # Parent 0c6e62729784f2d30a7e414beac47ccff25944b7 Also check the location of the picture start code and picture coding extension a little. diff -r 0c6e62729784 -r 8aff2b05e978 mpeg12.c --- a/mpeg12.c Sat Nov 28 22:51:53 2009 +0000 +++ b/mpeg12.c Sat Nov 28 23:05:06 2009 +0000 @@ -2306,6 +2306,7 @@ break; case PICTURE_START_CODE: + if(last_code == 0 || last_code == SLICE_MIN_START_CODE){ if(mpeg_decode_postinit(avctx) < 0){ av_log(avctx, AV_LOG_ERROR, "mpeg_decode_postinit() failure\n"); return -1; @@ -2316,6 +2317,9 @@ buf_ptr, input_size) < 0) s2->pict_type=0; last_code= PICTURE_START_CODE; + }else{ + av_log(avctx, AV_LOG_ERROR, "ignoring pic after %X\n", last_code); + } break; case EXT_START_CODE: init_get_bits(&s2->gb, buf_ptr, input_size*8); @@ -2338,8 +2342,11 @@ mpeg_decode_picture_display_extension(s); break; case 0x8: + if(last_code == PICTURE_START_CODE){ mpeg_decode_picture_coding_extension(s); - last_code= PICTURE_START_CODE; + }else{ + av_log(avctx, AV_LOG_ERROR, "ignoring pic cod ext after %X\n", last_code); + } break; } break;