Browse Source

Do not allow 0 sample rate in TMV demuxer

Originally committed as revision 20195 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Daniel Verkamp 15 years ago
parent
commit
54eb4ae0a2
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/tmv.c

+ 5
- 0
libavformat/tmv.c View File

@@ -77,6 +77,11 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);


ast->codec->sample_rate = get_le16(pb); 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); tmv->audio_chunk_size = get_le16(pb);
if (!tmv->audio_chunk_size) { if (!tmv->audio_chunk_size) {
av_log(s, AV_LOG_ERROR, "invalid audio chunk size\n"); av_log(s, AV_LOG_ERROR, "invalid audio chunk size\n");


Loading…
Cancel
Save