fix: do not load webxdc icon if it has too large dimensions - #8665
Conversation
nicodh
left a comment
There was a problem hiding this comment.
Reviewed by reading & testing
One comment, not a blocker
The fact that getWebxdcBlob for the app icon now needs error handling should be mentioned in the changelog imo
| }); | ||
| let (width, height) = image_reader | ||
| .into_dimensions() | ||
| .context("Failed to determine icon dimensions")?; |
There was a problem hiding this comment.
Wouldn't this result in a fail for any unintendedly wrong named icon? So a png that has a jpg ending would result in no icon at all? (while before this change it worked)
I saw image::guess_format in blob.rs - which seems to not rely on the file name. Maybe that would also work here?
There was a problem hiding this comment.
I changed to guess_format, but added a check to reject everything that is not PNG and JPEG so we don't have icons in arbitrary formats, especially GIF which may be animated and WebP which may be not supported everywhere anyway.
8b6d1dd to
d20e025
Compare
Added BREAKING CHANGE footer that will go into the changelog. |
BREAKING CHANGE: get_webxdc_blob() may fail to load icon.png or icon.jpg if image dimensions are too large. The issue is discovered by https://github.com/Sergei768
d20e025 to
60a80b6
Compare
BREAKING CHANGE: get_webxdc_blob() may fail to load icon.png or icon.jpg if image dimensions are too large.
The issue is discovered by https://github.com/Sergei768