check parsed floats for NaN in media info providers

pull/702/head
LukePulverenti 12 years ago
parent 40501ac1f3
commit 1b47be2d1f

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

@ -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;

Loading…
Cancel
Save