aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-28 10:54:35 +0100
committerReinhard Tartler <siretart@tauware.de>2014-02-02 12:48:58 -0500
commitb0db7a523df5ce5c5bcfb21d64a8f2a5fdcd5b42 (patch)
treeb10f68c9cac625346ea28ea5331746fa7b00137b /libavformat
parente03b875c0b57d458d3fc693b37b01615fc7283e7 (diff)
downloadffmpeg-b0db7a523df5ce5c5bcfb21d64a8f2a5fdcd5b42.tar.gz
oggparseogm: check timing variables
Fixes a potential divide by zero. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org (cherry picked from commit 75647dea6f7db79b409bad66a119f5c73da730f3) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit bf7c240a50f8ed99a42e08bb7a8a70262cce34ad) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggparseogm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index c761bbd7db..b74537c689 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 */