GCC warnings fix

This commit is contained in:
MihailRis
2023-11-23 19:26:40 +03:00
parent 50aa5fdc70
commit cc556bc19b
2 changed files with 17 additions and 4 deletions
+5 -1
View File
@@ -105,7 +105,11 @@ ImageData* _png_load(const char* file){
if (!(f = fopen(file, "r"))) {
return nullptr;
}
fread(header, 1, 8, f);
if (fread(header, 1, 8, f) < 8) {
fclose(f);
return nullptr;
}
is_png = !png_sig_cmp(header, 0, 8);
if (!is_png) {
fclose(f);