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 d323d4f091
commit d2c9a88ec5
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>
Leandro Moreira <leandro.ribeiro.moreira@gmail.com>
Philo Inc. <*@philo.com>
Richard Eklycke <richard@eklycke.se>
Sergio Ammirata <sergio@ammirata.net>
The Chromium Authors <*@chromium.org>

View File

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

View File

@ -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<uint8_t>& data) { codec_config_ = data; }
void set_codec_string(const std::string& codec_string) {