Prevent SVG security issues

This commit is contained in:
M66B
2022-07-09 09:13:45 +02:00
parent 638f9c1a22
commit 850973487a
2 changed files with 8 additions and 1 deletions

View File

@@ -126,7 +126,9 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
Log.w(ex);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
!"image/svg+xml".equals(type) &&
!"svg".equals(Helper.getExtension(file.getName())))
try {
return ImageHelper.getScaledDrawable(context, file, type, max);
} catch (Throwable ex) {