From a4573b4ad131069ad5f41c3bd3eff5721217f3c2 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 17 Aug 2023 17:10:15 +0600 Subject: [PATCH] Fix QOI image loading --- src/common/textures/formats/qoitexture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/textures/formats/qoitexture.cpp b/src/common/textures/formats/qoitexture.cpp index 0bdba52c57..d0aa2fd810 100644 --- a/src/common/textures/formats/qoitexture.cpp +++ b/src/common/textures/formats/qoitexture.cpp @@ -64,6 +64,7 @@ FImageSource *QOIImage_TryCreate(FileReader &file, int lumpnum) return nullptr; } + file.Seek(0, FileReader::SeekSet); file.Read((void *)&header, sizeof(header)); if (header.magic[0] != 'q' || header.magic[1] != 'o' || header.magic[2] != 'i' || header.magic[3] != 'f') @@ -209,4 +210,4 @@ int FQOITexture::CopyPixels(FBitmap *bmp, int conversion) pixels += 4; } return bMasked? -1 : 0; -} \ No newline at end of file +}