Repository navigation
libobs: Refuse a zero frame rate in obs_reset_video (#1713) - #2174
Merged
Merged
Conversation
Member
Author
|
GREEN, local Tier 2 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1713 (its last part; #1773 ported the plan and left the fps 0 rejection for a follow-up).
obs_reset_video()computed the frame interval asutil_mul_div64(1e9, fps_den, fps_num)without checking either value:fps_num0 divided by zero, andfps_den0 gave a zero frame interval. Both now returnOBS_VIDEO_INVALID_PARAMnext to the existing size checks, before anything is freed, so the running video stays.test: obs_reset_video must refuse a zero frame rate…): the newtest_video_reset_fps(Linux, xvfb, public API, so it covers C and hybrid libobs) failszero_fps_refused_before_teardownin both the OFF and ON suites of local Tier 2.libobs/obs.c.h; PR CI's Tier 2 confirms it. No existing C test or public header changed. No Rust change: the check is in the C reset path, which both backends share; the Rustvideo_plantakes sizes only.obs_reset_video).