Ensure pthread_join succeeded before returning true

This commit is contained in:
Abdelrahman Said 2024-05-26 17:51:28 +01:00
parent 7593eb4732
commit 1c08881dfb

View File

@ -644,12 +644,17 @@ internal bool read_strips(TiffReader *reader) {
} }
} }
bool image_loaded = true;
for (u64 i = 0; i < reader->img.strip_count; ++i) { for (u64 i = 0; i < reader->img.strip_count; ++i) {
pthread_join(threads[i], NULL); if (pthread_join(threads[i], NULL) != 0) {
image_loaded = false;
}
fclose(args[i].fp); fclose(args[i].fp);
} }
return true; return image_loaded;
} }
internal void *read_strip(void *arg) { internal void *read_strip(void *arg) {