oiiodecoder: made line backwards compatible with OIIO < 2.1.x

This commit is contained in:
itsmattkc
2020-02-27 16:03:56 +11:00
parent a0f37ef827
commit 83c5cd2bc1
+4
View File
@@ -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;