-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle integer overflows and other stuff #1619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to prepare a little more structured errors so we could hint what's wrong and what's the correct value-range. Ideally we could move all the validation in a function like:
Config::validate() ->Result<(), ConfigError>
and call it inside the Context factory.
For use in tests.
Fixed, rebased, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good step in the right direction, some refactoring and considerations may happen later.
@@ -160,11 +160,12 @@ pub struct Sequence { | |||
} | |||
|
|||
impl Sequence { | |||
pub fn new(config: &EncoderConfig) -> Sequence { | |||
pub fn new(config: &EncoderConfig) -> Option<Sequence> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the assert and move the check (using ilog maybe) where the configuration is validated. The sequence is an internal detail and should never fail no matter the input.
I fuzzed things. Things broke.
Fixes #1616.
This changes the type of
rdo_lookahead_frames
inEncoderConfig
fromu64
tousize
. API change; merge this before 0.1 if possible?