6 Commits

4 changed files with 15 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: self-hosted
runs-on: dotnet
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
env:
GITEA_TOKEN: ${{ secrets.BUILD_SNOWCLOAK_CLIENT }}
run: |
API_URL="https://imbuilding.anuke.org/api/v1/repos/ProfessorFartsalot/SnowcloakClient/releases"
API_URL="https://git.snowcloak-sync.com/api/v1/repos/Eauldane/SnowcloakClient/releases"
TAG="v$(date +%Y%m%d%H%M)"
# Create release
RELEASE_ID=$(curl -s -X POST \

View File

@@ -2,7 +2,7 @@
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
<PropertyGroup>
<AssemblyName>Snowcloak</AssemblyName>
<Version>0.2.0.3</Version>
<Version>0.2.1</Version>
<PackageProjectUrl>https://github.com/Eauldane/SnowcloakClient/</PackageProjectUrl>
</PropertyGroup>

View File

@@ -20,7 +20,7 @@ public class PngHdr
stream.ReadExactly(buffer[..8]);
uint ihdrLength = BitConverter.ToUInt32(buffer);
uint ihdrLength = ReadBigEndianUInt32(buffer[..4]);
// The next four bytes will be the length of the IHDR section (it should be 13 bytes but we only need 8)
if (ihdrLength < 8)
@@ -32,8 +32,8 @@ public class PngHdr
stream.ReadExactly(buffer[..8]);
uint width = BitConverter.ToUInt32(buffer);
uint height = BitConverter.ToUInt32(buffer[4..]);
uint width = ReadBigEndianUInt32(buffer[..4]);
uint height = ReadBigEndianUInt32(buffer[4..8]);
// Validate the width/height are non-negative and... that's all we care about!
if (width > int.MaxValue || height > int.MaxValue)
@@ -46,4 +46,12 @@ public class PngHdr
return InvalidSize;
}
}
}
// Minimal helper for big-endian conversion
private static uint ReadBigEndianUInt32(ReadOnlySpan<byte> bytes)
{
return ((uint)bytes[0] << 24) |
((uint)bytes[1] << 16) |
((uint)bytes[2] << 8) |
bytes[3];
}
}

View File