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

pull/2/head
Mitchell Cash 8 years ago committed by Leonardo Galli
parent 17118cf24d
commit 3403ddf993

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

Loading…
Cancel
Save