Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-06 18:24:42 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-01-06 18:28:24 +0400
commit59725592a97fc65a917001bc248567666dfded5a (patch)
tree1295e014281fe87ee485112f1517e2d4c69e9055 /libavformat/oggparseogm.c
parent4e276b84e697ec9c21cec1fb0a4b2ad7e8cbf4ed (diff)
parent75647dea6f7db79b409bad66a119f5c73da730f3 (diff)
Merge commit '75647dea6f7db79b409bad66a119f5c73da730f3'
* commit '75647dea6f7db79b409bad66a119f5c73da730f3': oggparseogm: check timing variables See: 9ed388f5985992a0a6a43fdc0b1732962b6b5619 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggparseogm.c')
-rw-r--r--libavformat/oggparseogm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index fe4c1f23c4..95369df89e 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -79,6 +79,11 @@ ogm_header(AVFormatContext *s, int idx)
size = FFMIN(size, os->psize);
time_unit = bytestream2_get_le64(&p);
spu = bytestream2_get_le64(&p);
+ if (!time_unit || !spu) {
+ av_log(s, AV_LOG_ERROR, "Invalid timing values.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
bytestream2_skip(&p, 4); /* default_len */
bytestream2_skip(&p, 8); /* buffersize + bits_per_sample */
@@ -90,7 +95,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codec->channels = bytestream2_get_le16(&p);
bytestream2_skip(&p, 2); /* block_align */
st->codec->bit_rate = bytestream2_get_le32(&p) * 8;
- st->codec->sample_rate = time_unit ? spu * 10000000 / time_unit : 0;
+ st->codec->sample_rate = spu * 10000000 / time_unit;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
if (size >= 56 && st->codec->codec_id == AV_CODEC_ID_AAC) {
bytestream2_skip(&p, 4);