Skip to content

Commit

Permalink
avoid calling compression when there is nothing to do
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Sep 19, 2024
1 parent 8f76f50 commit 76c932a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/OpenEXRCore/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ exr_uncompress_chunk (exr_decode_pipeline_t* decode)
if ((decode->decode_flags & EXR_DECODE_SAMPLE_DATA_ONLY)) return rv;
}

if (rv == EXR_ERR_SUCCESS)
if (rv == EXR_ERR_SUCCESS &&
decode->chunk.packed_size > 0 &&
decode->chunk.unpacked_size > 0)
rv = decompress_data (
ctxt,
part->comp_type,
Expand Down

0 comments on commit 76c932a

Please sign in to comment.