Merge pull request #31 from vec4f/bug/qoi_read/fclose

Close file on allocation failure in `qoi_read()`
This commit is contained in:
Dominic Szablewski 2021-11-27 21:04:16 +01:00 committed by GitHub
commit be8d23c574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

1
qoi.h
View File

@ -556,6 +556,7 @@ void *qoi_read(const char *filename, qoi_desc *desc, int channels) {
void *data = QOI_MALLOC(size);
if (!data) {
fclose(f);
return NULL;
}