Possible integer overflow in StreamInfo::set_duration() #214
Labels
status: archived
Archived and locked; will not be updated
type: bug
Something isn't working correctly
System info
Operating System: Ubuntu 14.04 trusty
Shaka Packager Version: c223bc9-release
Issue and steps to reproduce the problem
When I tried to segment a WebM file with a long duration, I got a mediaPresentationDuration attribute in my MPD manifest that was about int64_t(-1), but written as floating point (it was something like 1.844e+13).
According to libwebm (using the mkvparser_sample program), my WebM stream header looks like this:
This duration will be (correctly) parsed by the WebM parser in the shaka-packager, but in WebMMediaParser::ParseInfoAndTracks(), where we should set the parsed duration to our AudioStreamInfo or VideoStreamInfo using StreamInfo::set_duration(), there will in this case be an integer overflow.
The reason is that the duration accepted by StreamInfo::set_duration() is int, as opposed to int64_t or uint64_t (which by the way is the internal representation for the duration in the StreamInfo class). Once I exchanged that to uint64_t, my mediaPresentationDuration was alright again.
Thank you for having a look! :)
The text was updated successfully, but these errors were encountered: