Skip to content

Commit 6e96fe1

Browse files
cary-ilmpixar-oss
authored andcommitted
Backport fix for CVE-2026-34544 in OpenEXRCore
This backports AcademySoftwareFoundation/openexr@35e7aa3 from OpenEXR upstream to address https://www.cve.org/CVERecord?id=CVE-2026-34544 and GHSA-h762-rhv3-h25v. Closes #4028 (Internal change: 2403675)
1 parent af41fb0 commit 6e96fe1

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,13 @@ compress_b44_impl (exr_encode_pipeline_t* encode, int flat_field)
390390
// rightmost column and the bottom row.
391391
//
392392
uint16_t *row0, *row1, *row2, *row3;
393+
/* row offset in elements: use uint64_t so y*nx cannot overflow int */
394+
uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx);
393395

394-
row0 = (uint16_t*) scratch;
395-
row0 += y * nx;
396-
397-
row1 = row0 + nx;
398-
row2 = row1 + nx;
399-
row3 = row2 + nx;
396+
row0 = (uint16_t*) scratch + row_off;
397+
row1 = row0 + (uint64_t) nx;
398+
row2 = row1 + (uint64_t) nx;
399+
row3 = row2 + (uint64_t) nx;
400400

401401
if (y + 3 >= ny)
402402
{
@@ -512,11 +512,12 @@ uncompress_b44_impl (
512512

513513
for (int y = 0; y < ny; y += 4)
514514
{
515-
row0 = (uint16_t*) scratch;
516-
row0 += y * nx;
517-
row1 = row0 + nx;
518-
row2 = row1 + nx;
519-
row3 = row2 + nx;
515+
/* row offset in elements: use uint64_t so y*nx cannot overflow int */
516+
uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx);
517+
row0 = (uint16_t*) scratch + row_off;
518+
row1 = row0 + (uint64_t) nx;
519+
row2 = row1 + (uint64_t) nx;
520+
row3 = row2 + (uint64_t) nx;
520521
for (int x = 0; x < nx; x += 4)
521522
{
522523
if (bIn + 3 > comp_buf_size) return EXR_ERR_OUT_OF_MEMORY;

0 commit comments

Comments
 (0)