Skip to content

Conversation

yogeshkumawat
Copy link

What this fixes

Prevents crash in LruBitmapPool.put() when a recycled bitmap is passed to the pool.

Why it matters

In rare cases, Glide attempts to pool a bitmap that has already been recycled — often due to race conditions during decode, transformation, or request cancellation. Since isRecycled() throws IllegalStateException, this leads to a fatal crash.

Fix

Add a defensive check and early return if the bitmap is already recycled. This mirrors similar fixes in other parts of Glide (e.g., GifDrawable.draw() crash protection).

Impact

  • ✅ Prevents crash without affecting cache logic
  • ✅ Improves robustness
  • ✅ Compatible with current logic (only avoids pooling invalid bitmaps)

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