diff --git a/src/Nazara/Utility/Formats/STBLoader.cpp b/src/Nazara/Utility/Formats/STBLoader.cpp index 62cb888a1..126f6203c 100644 --- a/src/Nazara/Utility/Formats/STBLoader.cpp +++ b/src/Nazara/Utility/Formats/STBLoader.cpp @@ -47,10 +47,14 @@ namespace Nz Result, ResourceLoadingError> LoadSTB(Stream& stream, const ImageParams& parameters) { + UInt64 streamPos = stream.GetCursorPos(); + int width, height, bpp; if (!stbi_info_from_callbacks(&s_stbiCallbacks, &stream, &width, &height, &bpp)) return Err(ResourceLoadingError::Unrecognized); + stream.SetCursorPos(streamPos); + // Load everything as RGBA8 and then convert using the Image::Convert method // This is because of a STB bug when loading some JPG images with default settings