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.
This commit is contained in:
sylt 2017-03-23 17:38:51 +01:00 committed by Kongqun Yang
parent 3c0f49577a
commit a092c3b461
3 changed files with 3 additions and 1 deletions

View File

@ -18,5 +18,6 @@ Chun-da Chen <capitalm.c@gmail.com>
Google Inc. <*@google.com> Google Inc. <*@google.com>
Leandro Moreira <leandro.ribeiro.moreira@gmail.com> Leandro Moreira <leandro.ribeiro.moreira@gmail.com>
Philo Inc. <*@philo.com> Philo Inc. <*@philo.com>
Richard Eklycke <richard@eklycke.se>
Sergio Ammirata <sergio@ammirata.net> Sergio Ammirata <sergio@ammirata.net>
The Chromium Authors <*@chromium.org> The Chromium Authors <*@chromium.org>

View File

@ -31,6 +31,7 @@ Jacob Trimble <modmaker@google.com>
Joey Parrish <joeyparrish@google.com> Joey Parrish <joeyparrish@google.com>
Kongqun Yang <kqyang@google.com> Kongqun Yang <kqyang@google.com>
Leandro Moreira <leandro.ribeiro.moreira@gmail.com> Leandro Moreira <leandro.ribeiro.moreira@gmail.com>
Richard Eklycke <richard@eklycke.se>
Rintaro Kuroiwa <rkuroiwa@google.com> Rintaro Kuroiwa <rkuroiwa@google.com>
Sergio Ammirata <sergio@ammirata.net> Sergio Ammirata <sergio@ammirata.net>
Thomas Inskip <tinskip@google.com> Thomas Inskip <tinskip@google.com>

View File

@ -74,7 +74,7 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
const std::string& language() const { return language_; } const std::string& language() const { return language_; }
bool is_encrypted() const { return is_encrypted_; } 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(Codec codec) { codec_ = codec; }
void set_codec_config(const std::vector<uint8_t>& data) { codec_config_ = data; } void set_codec_config(const std::vector<uint8_t>& data) { codec_config_ = data; }
void set_codec_string(const std::string& codec_string) { void set_codec_string(const std::string& codec_string) {