changeset 10596:a228e8e3e347 libavcodec

Print errors instead of just ignoring contradictionary values in mpeg2 silently.
author michael
date Sun, 29 Nov 2009 14:31:40 +0000
parents c58c770b17f5
children 4dac6529ee0c
files mpeg12.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Sun Nov 29 03:32:30 2009 +0000
+++ b/mpeg12.c	Sun Nov 29 14:31:40 2009 +0000
@@ -1545,10 +1545,18 @@
     s->chroma_420_type = get_bits1(&s->gb);
     s->progressive_frame = get_bits1(&s->gb);
 
-    if(s->progressive_sequence)
+    if(s->progressive_sequence && !s->progressive_frame){
         s->progressive_frame= 1;
-    if(s->progressive_frame){
+        av_log(s->avctx, AV_LOG_ERROR, "interlaced frame in progressive sequence, ignoring\n");
+    }
+
+    if(s->picture_structure==0 || (s->progressive_frame && s->picture_structure!=PICT_FRAME)){
+        av_log(s->avctx, AV_LOG_ERROR, "picture_structure %d invalid, ignoring\n", s->picture_structure);
         s->picture_structure= PICT_FRAME;
+    }
+
+    if(s->progressive_frame && !s->frame_pred_frame_dct){
+        av_log(s->avctx, AV_LOG_ERROR, "invalid frame_pred_frame_dct\n");
         s->frame_pred_frame_dct= 1;
     }