Skip to content

Commit

Permalink
Update tinyexr.
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Jul 27, 2024
1 parent fc262d0 commit 1a8f583
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/external/tinyexr.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ extern int IsEXRFromMemory(const unsigned char *memory, size_t size);
// error
extern int SaveEXRToMemory(const float *data, const int width, const int height,
const int components, const int save_as_fp16,
const unsigned char **buffer, const char **err);
unsigned char **buffer, const char **err);

// @deprecated { Not recommended, but handy to use. }
// Saves single-frame OpenEXR image to a buffer. Assume EXR image contains RGB(A) channels.
Expand Down Expand Up @@ -4923,7 +4923,7 @@ static int DecodeTiledLevel(EXRImage* exr_image, const EXRHeader* exr_header,
}
#endif
exr_image->tiles = static_cast<EXRTile*>(
calloc(sizeof(EXRTile), static_cast<size_t>(num_tiles)));
calloc(static_cast<size_t>(num_tiles), sizeof(EXRTile)));

#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
std::vector<std::thread> workers;
Expand Down Expand Up @@ -9008,7 +9008,7 @@ int LoadEXRMultipartImageFromFile(EXRImage *exr_images,
}

int SaveEXRToMemory(const float *data, int width, int height, int components,
const int save_as_fp16, const unsigned char **outbuf, const char **err) {
const int save_as_fp16, unsigned char **outbuf, const char **err) {

if ((components == 1) || components == 3 || components == 4) {
// OK
Expand Down Expand Up @@ -9287,9 +9287,6 @@ int SaveEXR(const float *data, int width, int height, int components,
}

int ret = SaveEXRImageToFile(&image, &header, outfilename, err);
if (ret != TINYEXR_SUCCESS) {
return ret;
}

free(header.channels);
free(header.pixel_types);
Expand Down

0 comments on commit 1a8f583

Please sign in to comment.