Skip to content

fix: do not load webxdc icon if it has too large dimensions - #8665

Merged
link2xt merged 1 commit into
mainfrom
link2xt/webxdc-icon-checks
Sep 4, 2026
Merged

fix: do not load webxdc icon if it has too large dimensions#8665
link2xt merged 1 commit into
mainfrom
link2xt/webxdc-icon-checks

Conversation

@link2xt

@link2xt link2xt commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

@link2xt
link2xt requested a review from nicodh September 3, 2026 12:48
@link2xt
link2xt marked this pull request as ready for review September 3, 2026 16:44

@nicodh nicodh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/webxdc.rs
});
let (width, height) = image_reader
.into_dimensions()
.context("Failed to determine icon dimensions")?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@link2xt
link2xt force-pushed the link2xt/webxdc-icon-checks branch 3 times, most recently from 8b6d1dd to d20e025 Compare September 4, 2026 09:42
@link2xt

link2xt commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

The fact that getWebxdcBlob for the app icon now needs error handling should be mentioned in the changelog imo

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
@link2xt
link2xt force-pushed the link2xt/webxdc-icon-checks branch from d20e025 to 60a80b6 Compare September 4, 2026 09:46
@link2xt
link2xt merged commit 506a78b into main Sep 4, 2026
30 checks passed
@link2xt
link2xt deleted the link2xt/webxdc-icon-checks branch September 4, 2026 10:05
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.

2 participants