[FFmpeg-cvslog] h264: Workaround invalid flag combinations of 8x8 inference.
Michael Niedermayer
git at videolan.org
Sat Oct 15 15:40:47 CEST 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 15 15:32:34 2011 +0200| [2ed7e353bd8867215bc156c430d4ded7f6774ad4] | committer: Michael Niedermayer
h264: Workaround invalid flag combinations of 8x8 inference.
Fixes Ticket555
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ed7e353bd8867215bc156c430d4ded7f6774ad4
---
libavcodec/h264.c | 4 ++++
libavcodec/h264_ps.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 071a6ad..885721c 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 {
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 158ca32..93697a8 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -408,10 +408,6 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->mb_aff= 0;
sps->direct_8x8_inference_flag= get_bits1(&s->gb);
- if(!sps->frame_mbs_only_flag && !sps->direct_8x8_inference_flag){
- av_log(h->s.avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
- goto fail;
- }
#ifndef ALLOW_INTERLACE
if(sps->mb_aff)
More information about the ffmpeg-cvslog
mailing list