Commit e47daf60 authored by Evgeny Stambulchik's avatar Evgeny Stambulchik

Make sure guint64 is not overflown

parent 7866954b
Pipeline #58067 passed with stages
in 13 minutes and 3 seconds
......@@ -118,17 +118,19 @@ _poppler_movie_new (const Movie *poppler_movie)
movie->rate = poppler_movie->getActivationParameters()->rate;
if (poppler_movie->getActivationParameters()->start.units_per_second > 0) {
movie->start = 1000000000L*
poppler_movie->getActivationParameters()->start.units/
if (poppler_movie->getActivationParameters()->start.units_per_second > 0 &&
poppler_movie->getActivationParameters()->start.units <= G_MAXUINT64 / 1000000000) {
movie->start = 1000000000L *
poppler_movie->getActivationParameters()->start.units /
poppler_movie->getActivationParameters()->start.units_per_second;
} else {
movie->start = 0L;
}
if (poppler_movie->getActivationParameters()->duration.units_per_second > 0) {
movie->duration = 1000000000L*
poppler_movie->getActivationParameters()->duration.units/
if (poppler_movie->getActivationParameters()->duration.units_per_second > 0 &&
poppler_movie->getActivationParameters()->duration.units <= G_MAXUINT64 / 1000000000) {
movie->duration = 1000000000L *
poppler_movie->getActivationParameters()->duration.units /
poppler_movie->getActivationParameters()->duration.units_per_second;
} else {
movie->duration = 0L;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment