diff options
author | Daniel Verkamp <daniel@drv.nu> | 2009-10-09 18:29:19 +0000 |
---|---|---|
committer | Daniel Verkamp <daniel@drv.nu> | 2009-10-09 18:29:19 +0000 |
commit | 54eb4ae0a2da947d3c509a7eaaeb91a86d9fa2ee (patch) | |
tree | 3d2b8f9eccefc4e4d3c4b5f32f3fbdfafa7528cf /libavformat/tmv.c | |
parent | f19ae9ea4dbde5e9ffb19202e708443c111fc1cc (diff) | |
download | ffmpeg-54eb4ae0a2da947d3c509a7eaaeb91a86d9fa2ee.tar.gz |
Do not allow 0 sample rate in TMV demuxer
Originally committed as revision 20195 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/tmv.c')
-rw-r--r-- | libavformat/tmv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 4561a030e9..ab6a14f172 100644 --- a/libavformat/tmv.c +++ b/libavformat/tmv.c @@ -77,6 +77,11 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) return AVERROR(ENOMEM); ast->codec->sample_rate = get_le16(pb); + if (!ast->codec->sample_rate) { + av_log(s, AV_LOG_ERROR, "invalid sample rate\n"); + return -1; + } + tmv->audio_chunk_size = get_le16(pb); if (!tmv->audio_chunk_size) { av_log(s, AV_LOG_ERROR, "invalid audio chunk size\n"); |