summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-24 18:09:14 +0100
committerwm4 <wm4@nowhere>2016-01-24 18:09:14 +0100
commit75d29b14574c3df98729a0ab7c2a0134a1e2f5f3 (patch)
treee04c3723a8a2ffe4f14866585f7c2ff9f08ae30c /player
parent809786df42f7fc4bdfdeadd93638df57c21012ab (diff)
downloadmpv-75d29b14574c3df98729a0ab7c2a0134a1e2f5f3.tar.bz2
mpv-75d29b14574c3df98729a0ab7c2a0134a1e2f5f3.tar.xz
video: limit maximum number of VO frames correctly
Otherwise, vo_frame.frames can be unintentionally overflown, leading to undefined behavior in corner cases.
Diffstat (limited to 'player')
-rw-r--r--player/video.c2
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++)