Skip to content

Commit 8bc3fae

Browse files
authored
add checks to avoid using optimizations when inappropriate
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 <kdt3rd@gmail.com>
1 parent ad85f1a commit 8bc3fae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/OpenEXRCore/unpack.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,9 @@ internal_exr_match_decode (
14371437
/* other optimizations would not be difficult, but this will
14381438
* be the common one (where on encode / pack we want to do the
14391439
* opposite) */
1440-
if (sametype == (int) EXR_PIXEL_HALF &&
1440+
if (!hassampling &&
1441+
chanstofill == decode->channel_count &&
1442+
sametype == (int) EXR_PIXEL_HALF &&
14411443
sameouttype == (int) EXR_PIXEL_FLOAT)
14421444
{
14431445
if (simpinterleave > 0)

0 commit comments

Comments
 (0)