Skip to content

Commit

Permalink
fix: sanitizer new warnings about signed/unsigned offsets in openexr (#…
Browse files Browse the repository at this point in the history
…4351)

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Jul 22, 2024
1 parent a8d06f3 commit 096cb16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/openexr.imageio/exrinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,8 @@ OpenEXRInput::read_native_scanlines(int subimage, int miplevel, int ybegin,
const PartInfo& part(m_parts[m_subimage]);
size_t pixelbytes = m_spec.pixel_bytes(chbegin, chend, true);
size_t scanlinebytes = (size_t)m_spec.width * pixelbytes;
char* buf = (char*)data - m_spec.x * pixelbytes - ybegin * scanlinebytes;
char* buf = (char*)data - m_spec.x * stride_t(pixelbytes)
- ybegin * stride_t(scanlinebytes);

try {
if (part.luminance_chroma) {
Expand Down
3 changes: 2 additions & 1 deletion src/openexr.imageio/exroutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,8 @@ OpenEXROutput::write_scanlines(int ybegin, int yend, int z, TypeDesc format,
// the bytes to be written, but OpenEXR's frameBuffer.insert() wants
// where the address of the "virtual framebuffer" for the whole
// image.
char* buf = (char*)d - m_spec.x * pixel_bytes - y * scanlinebytes;
char* buf = (char*)d - m_spec.x * stride_t(pixel_bytes)
- y * stride_t(scanlinebytes);
try {
Imf::FrameBuffer frameBuffer;
size_t chanoffset = 0;
Expand Down

0 comments on commit 096cb16

Please sign in to comment.