Fix QOI image loading

This commit is contained in:
Cacodemon345 2023-08-17 17:10:15 +06:00 committed by Rachael Alexanderson
parent 2261dde791
commit a4573b4ad1

View file

@ -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;
}
}