[FFmpeg-devel] [PATCH] matroska: Ensure sample rate is always >= 1.
dalecurtis at chromium.org
dalecurtis at chromium.org
Tue Apr 17 03:05:27 CEST 2012
From: Dale Curtis <dalecurtis at chromium.org>
May no longer be necessary, but seems like a valid
enforcement.
Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
---
libavformat/matroskadec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a484c50..cdaeff7 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1680,7 +1680,7 @@ static int matroska_read_header(AVFormatContext *s)
}
} else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->sample_rate = track->audio.out_samplerate;
+ st->codec->sample_rate = FFMAX(1, track->audio.out_samplerate);
st->codec->channels = track->audio.channels;
if (st->codec->codec_id != CODEC_ID_AAC)
st->need_parsing = AVSTREAM_PARSE_HEADERS;
--
1.7.7.3
More information about the ffmpeg-devel
mailing list