mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fix exceptional resource leak CID18153
This commit is contained in:
parent
add96b6900
commit
01f737ad5a
@ -10428,11 +10428,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
public static bool IsBluRaySupFile(string subFileName)
|
||||
{
|
||||
var buffer = new byte[4];
|
||||
var fs = new FileStream(subFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) { Position = 0 };
|
||||
fs.Read(buffer, 0, 4);
|
||||
fs.Close();
|
||||
return (buffer[0] == 0x50 && buffer[1] == 0x47); // 80 + 71 - P G
|
||||
using (var fs = new FileStream(subFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
return fs.ReadByte() == 0x50
|
||||
&& fs.ReadByte() == 0x47; // 80 + 71 - P G
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsRarFile(string fileName)
|
||||
|
Loading…
Reference in New Issue
Block a user