[FFmpeg-cvslog] wmadec: check nb_frames

Michael Niedermayer git at videolan.org
Sun Mar 3 17:00:37 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Mar  3 16:50:47 2013 +0100| [6c6dc8ccea56d264d54c677215fc8faf94587919] | committer: Michael Niedermayer

wmadec: check nb_frames

Improves error message for Ticket968

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

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

 libavcodec/wmadec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index df5089f..cdd2850 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -827,6 +827,10 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
         /* read super frame header */
         skip_bits(&s->gb, 4); /* super frame index */
         nb_frames = get_bits(&s->gb, 4) - (s->last_superframe_len <= 0);
+        if (nb_frames <= 0) {
+            av_log(avctx, AV_LOG_ERROR, "nb_frames is %d\n", nb_frames);
+            return AVERROR_INVALIDDATA;
+        }
     } else {
         nb_frames = 1;
     }



More information about the ffmpeg-cvslog mailing list