Skip to content

Reject non-image URIs in UriBitmapImageDecoderResourceDecoder. - #5734

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_954851141
Open

Reject non-image URIs in UriBitmapImageDecoderResourceDecoder.#5734
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_954851141

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 27, 2026

Copy link
Copy Markdown

Reject non-image URIs in UriBitmapImageDecoderResourceDecoder.

When Glide__enable_image_decoder_bitmaps is enabled, Glide registers UriBitmapImageDecoderResourceDecoder to handle URIs. However, this decoder was handling all content/file URIs including videos, and trying to decode them via ImageDecoder, which does not support videos and causes crashes.

This CL fixes it by using a positive MIME type check in handles(). It now only handles URIs if they are confirmed images (excluding GIFs). For android.resource:// URIs, it still allows null MIME types to preserve resource image loading performance, as they can return null in tests/Robolectric.

Additionally, this CL fixes Javadoc compilation warnings in GlideBuilder.java and GlideFutures.java (using fully qualified names or code font for non-imported or private classes) to resolve build failures during export to GitHub.

@copybara-service
copybara-service Bot force-pushed the test_954851141 branch 5 times, most recently from 3094aea to aacc974 Compare July 30, 2026 18:05
When Glide__enable_image_decoder_bitmaps is enabled, Glide registers UriBitmapImageDecoderResourceDecoder to handle URIs. However, this decoder was handling all content/file URIs including videos, and trying to decode them via ImageDecoder, which does not support videos and causes crashes.

This CL fixes it by using a positive MIME type check in `handles()`. It now only handles URIs if they are confirmed images (excluding GIFs). For `android.resource://` URIs, it still allows null MIME types to preserve resource image loading performance, as they can return null in tests/Robolectric.

Additionally, this CL fixes Javadoc compilation warnings in `GlideBuilder.java` and `GlideFutures.java` (using fully qualified names or code font for non-imported or private classes) to resolve build failures during export to GitHub.

PiperOrigin-RevId: 954851141
@copybara-service copybara-service Bot changed the title Reject video URIs in UriBitmapImageDecoderResourceDecoder. Reject non-image URIs in UriBitmapImageDecoderResourceDecoder. Jul 30, 2026
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.

1 participant