The product of the number of chunks and the number of seconds to skip
may overflow the 32 bit multiplication. Add a cast to force 64 bit
arithmetics to avoid the overflow.
seconds += get_play_time();
seconds = PARA_MIN(seconds, (typeof(seconds))pt->seconds - 4);
seconds = PARA_MAX(seconds, 0);
- pt->start_chunk = pt->num_chunks * seconds / pt->seconds;
+ pt->start_chunk = (uint64_t)pt->num_chunks * seconds / pt->seconds;
pt->start_chunk = PARA_MIN(pt->start_chunk, pt->num_chunks - 1);
pt->start_chunk = PARA_MAX(pt->start_chunk, 0UL);
if (!pt->playing)