From 83c5cd2bc1670f5be4da87e59df16906c93f32c9 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 27 Feb 2020 16:03:56 +1100 Subject: [PATCH] oiiodecoder: made line backwards compatible with OIIO < 2.1.x --- app/codec/oiio/oiiodecoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/codec/oiio/oiiodecoder.cpp b/app/codec/oiio/oiiodecoder.cpp index c2de2b690..1e0e5562b 100644 --- a/app/codec/oiio/oiiodecoder.cpp +++ b/app/codec/oiio/oiiodecoder.cpp @@ -135,7 +135,11 @@ bool OIIODecoder::Open() // FIXME: Many OIIO pixel formats are not handled here type_ = PixelFormat::GetOIIOTypeDesc(pix_fmt_); +#if OIIO_VERSION < 20100 + buffer_ = new OIIO::ImageBuf(OIIO::ImageSpec(spec.width, spec.height, spec.nchannels, type_)); +#else buffer_ = new OIIO::ImageBuf(OIIO::ImageSpec(spec.width, spec.height, spec.nchannels, type_), OIIO::InitializePixels::No); +#endif image_->read_image(type_, buffer_->localpixels()); open_ = true;