From fc742a223eb4dedbefbdcf50d69903ff2d8b6af2 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 3 Oct 2023 21:21:50 +0530 Subject: [PATCH] Disable system decoder --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index d8232a83e..2ef92ecfc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -15,6 +15,8 @@ import android.provider.MediaStore.Images import android.widget.ImageView import com.bumptech.glide.Glide import com.bumptech.glide.Priority +import com.bumptech.glide.integration.webp.WebpBitmapFactory +import com.bumptech.glide.integration.webp.decoder.WebpDownsampler import com.bumptech.glide.integration.webp.decoder.WebpDrawable import com.bumptech.glide.integration.webp.decoder.WebpDrawableTransformation import com.bumptech.glide.load.DataSource @@ -539,9 +541,11 @@ fun Context.loadImageBase( options.optionalTransform(WebpDrawable::class.java, MultiTransformation(WebpDrawableTransformation(CenterCrop()), WebpDrawableTransformation(roundedCornersTransform))) } + WebpBitmapFactory.sUseSystemDecoder = false // CVE-2023-4863 var builder = Glide.with(applicationContext) .load(path) .apply(options) + .set(WebpDownsampler.USE_SYSTEM_DECODER, false) // CVE-2023-4863 .transition(DrawableTransitionOptions.withCrossFade(crossFadeDuration)) if (tryLoadingWithPicasso) {