Skip to content

Commit be51b4e

Browse files
committedDec 19, 2018
Use the requested config, not the previous config in SizeConfigStrategy.
Previously we'd use the config of the Bitmap that we happened to pull from the pool instead of the config we'd requested. This isn't frequently an issue because we only allow cross config re-use in a few cases and we also need a size match. However, it's clearly incorrect to ignore the requested config and can cause crashes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=217896479
1 parent a03ca14 commit be51b4e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/SizeConfigStrategy.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public Bitmap get(int width, int height, Bitmap.Config config) {
8080
if (result != null) {
8181
// Decrement must be called before reconfigure.
8282
decrementBitmapOfSize(bestKey.size, result);
83-
result.reconfigure(width, height,
84-
result.getConfig() != null ? result.getConfig() : Bitmap.Config.ARGB_8888);
83+
result.reconfigure(width, height, config);
8584
}
8685
return result;
8786
}

0 commit comments

Comments
 (0)
Please sign in to comment.