diff --git a/ArcFormats/ArcNSA.cs b/ArcFormats/ArcNSA.cs index 3f763200..b0980e96 100644 --- a/ArcFormats/ArcNSA.cs +++ b/ArcFormats/ArcNSA.cs @@ -176,9 +176,7 @@ namespace GameRes.Formats.ONScripter break; if (name_buffer.Length == name_len) { - byte[] new_buffer = new byte[checked(name_len/2*3)]; - Array.Copy (name_buffer, new_buffer, name_len); - name_buffer = new_buffer; + Array.Resize (ref name_buffer, checked(name_len/2*3)); } name_buffer[name_len] = b; } diff --git a/ArcFormats/ImageDRG.cs b/ArcFormats/ImageDRG.cs index dc8246ec..ea4533f8 100644 --- a/ArcFormats/ImageDRG.cs +++ b/ArcFormats/ImageDRG.cs @@ -95,12 +95,12 @@ namespace GameRes.Formats.DRS int stride = (int)info.Width*((info.BPP+7)/8); if (8 == info.BPP) { + file.Position = 44; format = PixelFormats.Indexed8; var palette_data = new byte[0x400]; if (palette_data.Length != file.Read (palette_data, 0, palette_data.Length)) throw new InvalidFormatException(); var palette = new Color[256]; - file.Position = 44; for (int i = 0; i < 256; ++i) { palette[i] = Color.FromRgb (palette_data[i*4+2], palette_data[i*4+1], palette_data[i*4]);