Skip to content

Commit e6108fc

Browse files
authored
Fix: Fixed crash that would occur when opening a large bitrate audio file (#13698)
1 parent 6ee2063 commit e6108fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Files.App/ViewModels/Properties/Items/FileProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ await LocationHelpers.GetAddressFromCoordinatesAsync((double?)list.Find(
166166
if (encodingBitrate?.Value is not null)
167167
{
168168
var sizes = new string[] { "Bps", "KBps", "MBps", "GBps" };
169-
var order = (int)Math.Floor(Math.Log((uint)encodingBitrate.Value, 1024));
169+
var order = Math.Min((int)Math.Floor(Math.Log((uint)encodingBitrate.Value, 1024)), 3);
170170
var readableSpeed = (uint)encodingBitrate.Value / Math.Pow(1024, order);
171171
encodingBitrate.Value = $"{readableSpeed:0.##} {sizes[order]}";
172172
}

0 commit comments

Comments
 (0)