aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrPandemic <bipbip500@gmail.com>2019-06-23 10:13:50 -0400
committerDrPandemic <bipbip500@gmail.com>2019-06-24 20:13:07 -0400
commit394d96246bf8a70c87f2fbcc2920edca9b5748e9 (patch)
tree604fe988a88e88d7f966b9ae9f9e1b86447da49d
parent084854d71d15d35945de1ce59a397d3f4e750b61 (diff)
Check path before opening image
-rw-r--r--CONTRIBUTORS.md3
-rw-r--r--Jellyfin.Drawing.Skia/SkiaEncoder.cs5
2 files changed, 7 insertions, 1 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index c3fcea1e2..29456598f 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -23,8 +23,9 @@
- [fruhnow](https://github.com/fruhnow)
- [Lynxy](https://github.com/Lynxy)
- [fasheng](https://github.com/fasheng)
- - [ploughpuff](https://github.com/ploughpuff)
+ - [ploughpuff](https://github.com/ploughpuff)
- [pjeanjean](https://github.com/pjeanjean)
+ - [DrPandemic](https://github.com/drpandemic)
# Emby Contributors
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
index 5060476ba..1eda817a3 100644
--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs
+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
@@ -185,6 +185,11 @@ namespace Jellyfin.Drawing.Skia
public ImageDimensions GetImageSize(string path)
{
+ if (!File.Exists(path))
+ {
+ throw new FileNotFoundException("File not found", path);
+ }
+
using (var s = new SKFileStream(path))
using (var codec = SKCodec.Create(s))
{