Skip to content

Commit

Permalink
fix issue with unpacking sample counts (#1630)
Browse files Browse the repository at this point in the history
When unpacking sample counts as "individual" counts (no longer
monotonic), it writes the total sample count to a value 1 past the
individual sample counts, but this is not in the packed data, so do not
expect to unpack that many values. The buffer just needs to be allocated
one value larger to avoid write past end of buffer which is taken care
of in the update_pack_unpack_ptrs function

Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd authored and cary-ilm committed Feb 10, 2024
1 parent 2806065 commit d8cb68d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lib/OpenEXRCore/decoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ default_decompress_chunk (exr_decode_pipeline_t* decode)
(((uint64_t) decode->chunk.width) *
((uint64_t) decode->chunk.height));

if ((decode->decode_flags & EXR_DECODE_SAMPLE_COUNTS_AS_INDIVIDUAL))
sampsize += 1;
sampsize *= sizeof (int32_t);

rv = decompress_data (
Expand Down

0 comments on commit d8cb68d

Please sign in to comment.