diff --git a/app/codec/oiio/oiiodecoder.cpp b/app/codec/oiio/oiiodecoder.cpp index ebd522c9e..52653df05 100644 --- a/app/codec/oiio/oiiodecoder.cpp +++ b/app/codec/oiio/oiiodecoder.cpp @@ -240,9 +240,15 @@ void OIIODecoder::BufferToFrame(OIIO::ImageBuf *buf, FramePtr frame) // See more: https://github.com/OpenImageIO/oiio/pull/2487 // for (int i=0;ispec().height;i++) { + int width_in_bytes = frame->width() * PixelFormat::BytesPerPixel(frame->format()); + memcpy(frame->data() + i * frame->linesize_bytes(), +#if OIIO_VERSION < 10903 + reinterpret_cast(buf->localpixels()) + i * width_in_bytes, +#else reinterpret_cast(buf->localpixels()) + i * buf->scanline_stride(), - frame->width() * PixelFormat::BytesPerPixel(frame->format())); +#endif + width_in_bytes); } #else buf->get_pixels(OIIO::ROI(),