diff options
author | wm4 <wm4@nowhere> | 2016-01-24 18:09:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-24 18:09:14 +0100 |
commit | 75d29b14574c3df98729a0ab7c2a0134a1e2f5f3 (patch) | |
tree | e04c3723a8a2ffe4f14866585f7c2ff9f08ae30c | |
parent | 809786df42f7fc4bdfdeadd93638df57c21012ab (diff) |
video: limit maximum number of VO frames correctly
Otherwise, vo_frame.frames can be unintentionally overflown, leading to
undefined behavior in corner cases.
-rw-r--r-- | player/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index e9f9f5855d..67bf1385aa 100644 --- a/player/video.c +++ b/player/video.c @@ -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++) |