From 75d29b14574c3df98729a0ab7c2a0134a1e2f5f3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Jan 2016 18:09:14 +0100 Subject: video: limit maximum number of VO frames correctly Otherwise, vo_frame.frames can be unintentionally overflown, leading to undefined behavior in corner cases. --- player/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') 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++) -- cgit v1.2.3