diff --git a/FreeMote.Psb/Types/MapType.cs b/FreeMote.Psb/Types/MapType.cs index 8b0d72b..aa00f3d 100644 --- a/FreeMote.Psb/Types/MapType.cs +++ b/FreeMote.Psb/Types/MapType.cs @@ -39,6 +39,10 @@ private List FindTileResources(PSB psb, bool deDuplication) } var md = PsbResHelper.GenerateImageMetadata(image, null); + if (obj.ContainsKey("label") && (string.IsNullOrEmpty(md.Name) || md.Name == "image")) + { + md.Name = obj["label"].ToString(); + } md.PsbType = PsbType.Map; md.Spec = psb.Platform; resList.Add(md); diff --git a/FreeMote/PostProcessing.cs b/FreeMote/PostProcessing.cs index 74d2357..893d6ae 100644 --- a/FreeMote/PostProcessing.cs +++ b/FreeMote/PostProcessing.cs @@ -205,6 +205,10 @@ public static byte[] UntileTextureRvl(byte[] pixelData, int width, int height, i if (!compactMode) { + if (dataIndex >= pixelData.Length) + { + break; + } Buffer.BlockCopy(pixelData, dataIndex, untiledData, pixelIndex, bpp); dataIndex += bpp; }