changeset 5270:80542fdaba5e libavformat

Do not allow 0 sample rate in TMV demuxer
author daniel
date Fri, 09 Oct 2009 18:29:19 +0000
parents bcd5ff60e3da
children 9a5be9006cf7
files tmv.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tmv.c	Fri Oct 09 18:24:47 2009 +0000
+++ b/tmv.c	Fri Oct 09 18:29:19 2009 +0000
@@ -77,6 +77,11 @@
         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");