check parsed floats for NaN in media info providers

This commit is contained in:
LukePulverenti 2013-03-12 11:17:43 -04:00
parent 40501ac1f3
commit 1b47be2d1f
4 changed files with 8 additions and 4 deletions

View File

@ -201,7 +201,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MediaInfo\ffmpeg20130310.zip" />
<EmbeddedResource Include="MediaInfo\ffmpeg20130312.zip" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>

View File

@ -1 +0,0 @@
a005e50576665b191cbd02b42d6260bffb764690

View File

@ -0,0 +1 @@
629771e1793534eea1b867e8333f22a829acc35f

View File

@ -262,11 +262,15 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
{
var parts = value.Split('/');
float result;
if (parts.Length == 2)
{
return float.Parse(parts[0]) / float.Parse(parts[1]);
result = float.Parse(parts[0]) / float.Parse(parts[1]);
}
return float.Parse(parts[0]);
result = float.Parse(parts[0]);
return float.IsNaN(result) ? (float?)null : result;
}
return null;