Check path before opening image

This commit is contained in:
DrPandemic 2019-06-23 10:13:50 -04:00
parent 084854d71d
commit 394d96246b
No known key found for this signature in database
GPG Key ID: B6A2F8AEC8AD2825
2 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@
- [fasheng](https://github.com/fasheng)
- [ploughpuff](https://github.com/ploughpuff)
- [pjeanjean](https://github.com/pjeanjean)
- [DrPandemic](https://github.com/drpandemic)
# Emby Contributors

View File

@ -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))
{