aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wavdec.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-07-30 20:33:28 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-31 03:17:55 +0200
commitc1bfb99ff2445c7f3ba319ea342dd8004345d67a (patch)
tree82f2ebc43ff45662904ecf4061b89e8df62e854f /libavformat/wavdec.c
parenta0092cea462ff4f203aaff09c42c6731c6516b44 (diff)
downloadffmpeg-c1bfb99ff2445c7f3ba319ea342dd8004345d67a.tar.gz
avformat/wavdec: add extra sample count check for G.729 files
Can be used to fix Ticket4577 Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r--libavformat/wavdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 1803b5cdaf..8b48fc864d 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