Skip to content

Commit

Permalink
move out of bounds check inside loop
Browse files Browse the repository at this point in the history
Fixes OSS-Fuzz 45899
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45899

Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Apr 1, 2022
1 parent 3b0aaaa commit e2919b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/OpenEXRCore/parse_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,10 @@ internal_exr_compute_chunk_offset_size (struct _internal_exr_part* curpart)
tilecount +=
((int64_t) curpart->tile_level_tile_count_x[lx] *
(int64_t) curpart->tile_level_tile_count_y[ly]);

if (tilecount > (int64_t) INT_MAX) return -1;
}
}
if (tilecount > (int64_t) INT_MAX) return -1;
retval = (int32_t) tilecount;
break;
case EXR_TILE_LAST_TYPE:
Expand Down

0 comments on commit e2919b5

Please sign in to comment.