mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
player: fix --end with large values
Causea a simple integer overflow. Fixes #4650.
This commit is contained in:
parent
0b10a07b63
commit
8ef50016be
@ -800,8 +800,11 @@ static bool copy_output(struct MPContext *mpctx, struct mp_audio_buffer *outbuf,
|
||||
if (endpts != MP_NOPTS_VALUE) {
|
||||
double rate = afs->output.rate / mpctx->audio_speed;
|
||||
double curpts = written_audio_pts(mpctx);
|
||||
if (curpts != MP_NOPTS_VALUE)
|
||||
maxsamples = (endpts - curpts - mpctx->opts->audio_delay) * rate;
|
||||
if (curpts != MP_NOPTS_VALUE) {
|
||||
double remaining =
|
||||
(endpts - curpts - mpctx->opts->audio_delay) * rate;
|
||||
maxsamples = MPCLAMP(remaining, 0, INT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
struct mp_audio *mpa = af_read_output_frame(afs);
|
||||
|
Loading…
Reference in New Issue
Block a user