Skip to content

Commit

Permalink
don't validate chunk size when file_size unknown (#1163)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman authored Oct 2, 2021
1 parent 5d67067 commit 6f59bef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/OpenEXRCore/chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ extract_chunk_table (
return ctxt->report_error (
ctxt, EXR_ERR_INVALID_ARGUMENT, "Invalid file with no chunks");

if (chunkbytes + chunkoff > (uint64_t) ctxt->file_size)
if (ctxt->file_size > 0 &&
chunkbytes + chunkoff > (uint64_t) ctxt->file_size)
return ctxt->print_error (
ctxt,
EXR_ERR_INVALID_ARGUMENT,
Expand Down

0 comments on commit 6f59bef

Please sign in to comment.