[FFmpeg-cvslog] mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence ()

Michael Niedermayer git at videolan.org
Fri Dec 5 22:18:32 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 24 17:04:58 2014 +0000| [b56afb48aecb96e03347f5b569f16a64147c18b1] | committer: Vittorio Giovara

mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b56afb48aecb96e03347f5b569f16a64147c18b1
---

 libavcodec/mpeg12dec.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index b66bdc1..c7ee5ae 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2082,11 +2082,16 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
             return -1;
     }
     s->frame_rate_index = get_bits(&s->gb, 4);
-    if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
+    if (s->frame_rate_index == 0 || s->frame_rate_index > 13) {
+        av_log(avctx, AV_LOG_WARNING,
+               "frame_rate_index %d is invalid\n", s->frame_rate_index);
         return -1;
+    }
     s->bit_rate = get_bits(&s->gb, 18) * 400;
-    if (get_bits1(&s->gb) == 0) /* marker */
+    if (get_bits1(&s->gb) == 0) { /* marker */
+        av_log(avctx, AV_LOG_ERROR, "Marker in sequence header missing\n");
         return -1;
+    }
     s->width  = width;
     s->height = height;
 



More information about the ffmpeg-cvslog mailing list