From 76c932a856f612fb676fb4bfce33f6c1ff4147cd Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Fri, 20 Sep 2024 00:50:24 +1200 Subject: [PATCH] avoid calling compression when there is nothing to do Signed-off-by: Kimball Thurston --- src/lib/OpenEXRCore/compression.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/OpenEXRCore/compression.c b/src/lib/OpenEXRCore/compression.c index ea7c9ff2af..9271e1daa9 100644 --- a/src/lib/OpenEXRCore/compression.c +++ b/src/lib/OpenEXRCore/compression.c @@ -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,