diff --git a/aegisub/src/command/video.cpp b/aegisub/src/command/video.cpp index 6814769b0..f49aad6bc 100644 --- a/aegisub/src/command/video.cpp +++ b/aegisub/src/command/video.cpp @@ -381,8 +381,7 @@ struct video_frame_next_keyframe : public validator_video_loaded { void operator()(agi::Context *c) { std::vector const& kf = c->videoController->GetKeyFrames(); - std::vector::const_iterator pos = lower_bound(kf.begin(), kf.end(), c->videoController->GetFrameN()); - if (pos != kf.end()) ++pos; + std::vector::const_iterator pos = lower_bound(kf.begin(), kf.end(), c->videoController->GetFrameN() + 1); c->videoController->JumpToFrame(pos == kf.end() ? c->videoController->GetFrameN() - 1 : *pos); }