Skip to content
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

Possible Incompleteness #2103

Open
YichiZhang0613 opened this issue Mar 2, 2024 · 0 comments
Open

Possible Incompleteness #2103

YichiZhang0613 opened this issue Mar 2, 2024 · 0 comments

Comments

@YichiZhang0613
Copy link

In glium/src/framebuffer/mod.rs, I think the code should check samples != Some(0) and layers != Some(0) as comments mentioned before use them to avoid possible panic.

 /// # Panic
    ///
    /// Panics if `layers` or `samples` is equal to `Some(0)`.
    ///
    #[inline]
    pub fn new<F: ?Sized>(facade: &F, width: u32, height: u32, layers: Option<u32>,
                  samples: Option<u32>, fixed_samples: bool)
                  -> Result<EmptyFrameBuffer, ValidationError> where F: Facade
    {
        let context = facade.get_context();

        let attachments = fbo::FramebufferAttachments::Empty {
            width,
            height,
            layers,
            samples,
            fixed_samples,
        };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant