Skip to content

Commit

Permalink
Fix QOI image loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 authored and madame-rachelle committed Aug 17, 2023
1 parent 2261dde commit a4573b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/textures/formats/qoitexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -209,4 +210,4 @@ int FQOITexture::CopyPixels(FBitmap *bmp, int conversion)
pixels += 4;
}
return bMasked? -1 : 0;
}
}

0 comments on commit a4573b4

Please sign in to comment.