[FFmpeg-cvslog] avformat/wavdec: add extra sample count check for G.729 files

Ganesh Ajjanagadde git at videolan.org
Fri Jul 31 03:28:29 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Thu Jul 30 20:33:28 2015 -0400| [c1bfb99ff2445c7f3ba319ea342dd8004345d67a] | committer: Michael Niedermayer

avformat/wavdec: add extra sample count check for G.729 files

Can be used to fix Ticket4577

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/wavdec.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 1803b5c..8b48fc8 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -440,6 +440,13 @@ break_loop:
         sample_count = 0;
     }
 
+    /* G.729 hack (for Ticket4577)
+     * FIXME: Come up with cleaner, more general solution */
+    if (st->codec->codec_id == AV_CODEC_ID_G729 && sample_count && (data_size << 3) > sample_count) {
+        av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
+        sample_count = 0;
+    }
+
     if (!sample_count || av_get_exact_bits_per_sample(st->codec->codec_id) > 0)
         if (   st->codec->channels
             && data_size



More information about the ffmpeg-cvslog mailing list