Reject non-image URIs in UriBitmapImageDecoderResourceDecoder. - #5734
Open
copybara-service[bot] wants to merge 1 commit into
Open
Reject non-image URIs in UriBitmapImageDecoderResourceDecoder.#5734copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_954851141
branch
5 times, most recently
from
July 30, 2026 18:05
3094aea to
aacc974
Compare
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
Bot
force-pushed
the
test_954851141
branch
from
July 30, 2026 18:09
aacc974 to
76f37d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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). Forandroid.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.javaandGlideFutures.java(using fully qualified names or code font for non-imported or private classes) to resolve build failures during export to GitHub.