Skip to content

Commit 6b4f081

Browse files
authored
fix(imagebuf): fix set_pixels bug, didn't consider roi = All (#4949)
Signed-off-by: Larry Gritz <[email protected]>
1 parent 98e7dea commit 6b4f081

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libOpenImageIO/imagebuf.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,9 @@ bool
27692769
ImageBuf::set_pixels(ROI roi, TypeDesc format, const void* data,
27702770
stride_t xstride, stride_t ystride, stride_t zstride)
27712771
{
2772+
if (!roi.defined())
2773+
roi = this->roi();
2774+
roi.chend = std::min(roi.chend, nchannels());
27722775
image_span<const std::byte> s(reinterpret_cast<const std::byte*>(data),
27732776
roi.nchannels(), roi.width(), roi.height(),
27742777
roi.depth(), format.size(), xstride, ystride,

0 commit comments

Comments
 (0)