mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(BmpFormat.Read): reset file position after extension failure.
This commit is contained in:
@@ -62,6 +62,7 @@ namespace GameRes
|
|||||||
var bmp_info = info as BmpMetaData;
|
var bmp_info = info as BmpMetaData;
|
||||||
if (bmp_info != null)
|
if (bmp_info != null)
|
||||||
{
|
{
|
||||||
|
bool can_seek = file.CanSeek;
|
||||||
foreach (var ext in m_extensions)
|
foreach (var ext in m_extensions)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -74,6 +75,8 @@ namespace GameRes
|
|||||||
{
|
{
|
||||||
System.Diagnostics.Trace.WriteLine (X.Message, ext.ToString());
|
System.Diagnostics.Trace.WriteLine (X.Message, ext.ToString());
|
||||||
}
|
}
|
||||||
|
if (can_seek)
|
||||||
|
file.Position = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var decoder = new BmpBitmapDecoder (file,
|
var decoder = new BmpBitmapDecoder (file,
|
||||||
|
|||||||
Reference in New Issue
Block a user