From e7400adabc5bb76e8e741ed174bd7a475c51159b Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 1 May 2020 18:19:08 +1000 Subject: [PATCH] oiiodecoder: added compatibility for OIIO 1.x --- app/codec/oiio/oiiodecoder.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(),