Index: GUIMusic/MusicSort.cs =================================================================== --- GUIMusic/MusicSort.cs (revision 27893) +++ GUIMusic/MusicSort.cs (working copy) @@ -223,11 +223,13 @@ } if (bAscending) { - return (int)(item1.FileInfo.Length - item2.FileInfo.Length); + long compare = (item1.FileInfo.Length - item2.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } else { - return (int)(item2.FileInfo.Length - item1.FileInfo.Length); + long compare = (item2.FileInfo.Length - item1.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } case SortMethod.Track: Index: GUIPictures/GUIPictures.cs =================================================================== --- GUIPictures/GUIPictures.cs (revision 27893) +++ GUIPictures/GUIPictures.cs (working copy) @@ -1134,11 +1134,13 @@ item2.Label2 = sizeItem2; if (sortAsc) { - return (int)(item1.FileInfo.Length - item2.FileInfo.Length); + long compare = (item1.FileInfo.Length - item2.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } else { - return (int)(item2.FileInfo.Length - item1.FileInfo.Length); + long compare = (item2.FileInfo.Length - item1.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } } return 0; Index: GUIVideoFiles/VideoSort.cs =================================================================== --- GUIVideoFiles/VideoSort.cs (revision 27893) +++ GUIVideoFiles/VideoSort.cs (working copy) @@ -176,11 +176,13 @@ { if (sortAscending) { - return (int)(item1.FileInfo.Length - item2.FileInfo.Length); + long compare = (item1.FileInfo.Length - item2.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } else { - return (int)(item2.FileInfo.Length - item1.FileInfo.Length); + long compare = (item2.FileInfo.Length - item1.FileInfo.Length); + return compare == 0 ? 0 : compare < 0 ? -1 : 1; } }