From d2c9a88ec50b8c64f992fe4ae98f60ea882f91e7 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 1332feb802..f1cbf656f9 100644 --- a/packager/media/base/stream_info.h +++ b/packager/media/base/stream_info.h @@ -86,7 +86,7 @@ class StreamInfo { return encryption_config_; } - 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) {