Skip to content

Commit

Permalink
add checks to avoid using optimizations when inappropriate
Browse files Browse the repository at this point in the history
The fast unpack routines for 3 and 4 channels were not designed to
handle sub-sampled images, but need to appear before other fallback
disablement in the choice logic. Until that choice logic can be
simplified, add additional checks to avoid heading to that branch

Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd authored Jan 1, 2025
1 parent ad85f1a commit 8bc3fae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/OpenEXRCore/unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,9 @@ internal_exr_match_decode (
/* other optimizations would not be difficult, but this will
* be the common one (where on encode / pack we want to do the
* opposite) */
if (sametype == (int) EXR_PIXEL_HALF &&
if (!hassampling &&
chanstofill == decode->channel_count &&
sametype == (int) EXR_PIXEL_HALF &&
sameouttype == (int) EXR_PIXEL_FLOAT)
{
if (simpinterleave > 0)
Expand Down

0 comments on commit 8bc3fae

Please sign in to comment.