aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-15 15:32:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-15 15:38:10 +0200
commit2ed7e353bd8867215bc156c430d4ded7f6774ad4 (patch)
tree58476b31b1a0e8b88a77daa799a781a0d94ebac9 /libavcodec/h264.c
parent1d0afec8fcfaca9736c927715ddd56a5902855ab (diff)
downloadffmpeg-2ed7e353bd8867215bc156c430d4ded7f6774ad4.tar.gz
h264: Workaround invalid flag combinations of 8x8 inference.
Fixes Ticket555 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 071a6ad1d2..885721c244 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2770,6 +2770,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
if(h->sps.frame_mbs_only_flag){
s->picture_structure= PICT_FRAME;
}else{
+ if(!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B){
+ av_log(h->s.avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
+ return -1;
+ }
if(get_bits1(&s->gb)) { //field_pic_flag
s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
} else {