Fixed: Zero length file causes MediaInfo hanging in 100% cpu load. (#1340)

This commit is contained in:
Mitchell Cash 2017-04-08 21:34:17 +10:00 committed by Leonardo Galli
commit 3403ddf993

View file

@ -189,6 +189,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
public int Open(Stream stream)
{
if (stream.Length < 1024)
{
return 0;
}
var isValid = (int)MediaInfo_Open_Buffer_Init(_handle, stream.Length, 0);
if (isValid == 1)
{