Skip to content

bugfix: Add favicon max allowed size to handle unreasonably large favicons.#7710

Merged
aibrahim- merged 1 commit intodevelopfrom
bugfix/aibrahim/favicon_too_large
Feb 10, 2026
Merged

bugfix: Add favicon max allowed size to handle unreasonably large favicons.#7710
aibrahim- merged 1 commit intodevelopfrom
bugfix/aibrahim/favicon_too_large

Conversation

@aibrahim-
Copy link
Contributor

@aibrahim- aibrahim- commented Feb 10, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/task/1212341818869426

Description

Handle unreasonably large favicons gracefully, by setting a max size in pixels.

Steps to test this PR

  1. Start a local HTTP server serving a page with a large apple-touch-icon:
    cd /tmp/favicon_test && python3 -m http.server 8888 (The test page serves a 6708×6708 PNG as its touch icon)
  2. On the device, open the DuckDuckGo browser and navigate to http://{your-server-ip}:8888
  3. Wait ~2 seconds for the touch icon to be discovered and downloaded
  4. Open the tab switcher
  5. Without the changes: App crashes with:
    RuntimeException: Canvas: trying to draw too large(179989056bytes) bitmap But with the changes shouldn't crash.

Note

Low Risk
Small, localized change that only constrains favicon bitmap dimensions; low risk aside from potential quality reduction for very large icons.

Overview
Prevents crashes from unreasonably large favicons by introducing a MAX_FAVICON_SIZE_PX cap (512px) and enforcing it across Glide favicon fetches.

Both async (CustomTarget) and sync (submit) download paths for disk and URL loads now request bitmaps at the capped size, limiting memory usage during decoding/rendering.

Written by Cursor Bugbot for commit 91ca909. This will update automatically on new commits. Configure here.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aibrahim- aibrahim- marked this pull request as ready for review February 10, 2026 09:40
@aibrahim- aibrahim- changed the title bugfix favicon size bugfix: Add favicon max allowed size in pixels Feb 10, 2026
@aibrahim- aibrahim- changed the title bugfix: Add favicon max allowed size in pixels bugfix: Add favicon max allowed size to handle unreasonably large favicons. Feb 10, 2026
@CDRussell CDRussell self-assigned this Feb 10, 2026
Copy link
Member

@CDRussell CDRussell left a comment

Choose a reason for hiding this comment

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

Working great, can confirm crash before and now working fine. Great work!

@aibrahim- aibrahim- merged commit ae60c90 into develop Feb 10, 2026
27 of 29 checks passed
@aibrahim- aibrahim- deleted the bugfix/aibrahim/favicon_too_large branch February 10, 2026 10:50
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