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

Fix crash when using covergrid + default art size #4151

Merged
merged 1 commit into from Oct 1, 2022

Conversation

afontenot
Copy link
Contributor

@afontenot afontenot commented Sep 27, 2022

The default config value for browsers.cover_size is -1. The new covergrid code works fine when the config value is absent, but with this default it will crash after requesting a negative size from GdkPixbuf.Pixbuf.new_from_file_at_size.

The default config value for browsers.cover_size is -1. The new
covergrid code works fine when the config file is absent, but with
this default it will crash after requesting a negative size from
`GdkPixbuf.Pixbuf.new_from_file_at_size`.
@declension
Copy link
Member

declension commented Sep 27, 2022

Is this fixing a documented issue / or have you seen this crash yourself?

@afontenot
Copy link
Contributor Author

Yes, I hit this myself - immediate crash when switching to covergrid. Probably not many people have hit it because it doesn't affect any released version, it's the new covergrid that's at fault. My config file contains the following:

cover_size = -1

The existing code for this config.getint("browsers", "cover_size", 48) returns -1, not 48, because the value in the config file is an integer. If you look at every other place cover_size is used in the code, it's sanity-checked in exactly the way I'm doing it in this PR.

@declension declension merged commit a22b9f0 into quodlibet:master Oct 1, 2022
@declension
Copy link
Member

Thanks @afontenot

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

Successfully merging this pull request may close these issues.

None yet

2 participants