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:
authorAnton Khirnov <anton@khirnov.net>2013-11-28 13:54:35 +0400
committerAnton Khirnov <anton@khirnov.net>2014-01-06 11:21:38 +0400
commit75647dea6f7db79b409bad66a119f5c73da730f3 (patch)
treee5875644f91ca4060151d48f14991c148b840b65 /libavformat/oggparseogm.c
parent8058284ce09030b47512746d726fb2ad3ae8a20f (diff)
oggparseogm: check timing variables
Fixes a potential divide by zero. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
Diffstat (limited to 'libavformat/oggparseogm.c')
-rw-r--r--libavformat/oggparseogm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index 56ea5575f2..23136257bf 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -75,6 +75,11 @@ ogm_header(AVFormatContext *s, int idx)
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 */