mirror of https://github.com/mpv-player/mpv
video: limit maximum number of VO frames correctly
Otherwise, vo_frame.frames can be unintentionally overflown, leading to undefined behavior in corner cases.
This commit is contained in:
parent
809786df42
commit
75d29b1457
|
@ -1291,7 +1291,7 @@ void write_video(struct MPContext *mpctx, double endpts)
|
|||
.pts = pts,
|
||||
.duration = -1,
|
||||
.still = mpctx->step_frames > 0,
|
||||
.num_frames = mpctx->num_next_frames,
|
||||
.num_frames = MPMIN(mpctx->num_next_frames, VO_MAX_REQ_FRAMES),
|
||||
.num_vsyncs = 1,
|
||||
};
|
||||
for (int n = 0; n < dummy.num_frames; n++)
|
||||
|
|
Loading…
Reference in New Issue