diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-06-25 12:44:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-25 12:44:29 -0500 |
| commit | 3c16c34386fc9e5139d2d17bd7af20c2bc3b2856 (patch) | |
| tree | 604fe988a88e88d7f966b9ae9f9e1b86447da49d | |
| parent | 084854d71d15d35945de1ce59a397d3f4e750b61 (diff) | |
| parent | 394d96246bf8a70c87f2fbcc2920edca9b5748e9 (diff) | |
Merge pull request #1485 from DrPandemic/fix-skia-segfault
Fix skia segfault
| -rw-r--r-- | CONTRIBUTORS.md | 3 | ||||
| -rw-r--r-- | Jellyfin.Drawing.Skia/SkiaEncoder.cs | 5 |
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)) { |
