From a092c3b46110ee3d8684d559353ac0fe37d580a8 Mon Sep 17 00:00:00 2001 From: sylt Date: Thu, 23 Mar 2017 17:38:51 +0100 Subject: [PATCH] Fix possible integer overflow in WebM duration The issue could lead to the MPD attribute mediaPresentationDuration being wrongly generated for WebM streams with a duration longer than INT32_MAX. The root-cause was that StreamInfo::set_duration() accepted an int instead of a uint64_t. This seems like a pure typo, since StreamInfo already uses a uint64_t internally for representing duration. --- AUTHORS | 1 + CONTRIBUTORS | 1 + packager/media/base/stream_info.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index f156b9c792..cc37e22214 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,5 +18,6 @@ Chun-da Chen Google Inc. <*@google.com> Leandro Moreira Philo Inc. <*@philo.com> +Richard Eklycke Sergio Ammirata The Chromium Authors <*@chromium.org> diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9a8afa8601..aa494eeaf0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -31,6 +31,7 @@ Jacob Trimble Joey Parrish Kongqun Yang Leandro Moreira +Richard Eklycke Rintaro Kuroiwa Sergio Ammirata Thomas Inskip diff --git a/packager/media/base/stream_info.h b/packager/media/base/stream_info.h index 7384d87bc1..20e4e15a13 100644 --- a/packager/media/base/stream_info.h +++ b/packager/media/base/stream_info.h @@ -74,7 +74,7 @@ class StreamInfo : public base::RefCountedThreadSafe { const std::string& language() const { return language_; } bool is_encrypted() const { return is_encrypted_; } - void set_duration(int duration) { duration_ = duration; } + void set_duration(uint64_t duration) { duration_ = duration; } void set_codec(Codec codec) { codec_ = codec; } void set_codec_config(const std::vector& data) { codec_config_ = data; } void set_codec_string(const std::string& codec_string) {