[Marshmallow] Fix OOM when decoding images

This commit is contained in:
FooIbar committed 2023-11-24 13:22:23 +08:00
1 parent ed640ab00e
commit 17a9c02f96
1 file changed
+1
@@ -125,6 +125,7 @@ class Image private constructor(drawable: Drawable, private val src: AutoCloseab
colorSpace = if (isAtLeastO) colorSpace else null,
size = Size(targetWidth, targetHeight),
scale = Scale.FILL,
allowInexactSize = true,
)
val drawable = ImageSource(src.source.openInputStream().source().buffer(), appCtx).use {
BitmapFactoryDecoder(it, options).decode().drawable