diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-11-23 20:17:12 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-11-23 20:17:12 +0400 |
commit | 39dc956f593b3406bf1d81fb83c557b7b51f5327 (patch) | |
tree | 50b59815aad48902a6563aefc8b944daf34c401e /source/blender/imbuf/intern/oiio/openimageio_api.cpp | |
parent | 5d5176095e82b34499e15d74f1fb76d56f4d9508 (diff) | |
parent | d846c9a3b75c3d6f20bc7ab7d2da6cdd18bbbef2 (diff) |
Merge branch 'master' into soc-2013-rigid_body_simsoc-2013-rigid_body_sim
Conflicts:
intern/rigidbody/CMakeLists.txt
release/datafiles/splash.png
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_view3d_types.h
Diffstat (limited to 'source/blender/imbuf/intern/oiio/openimageio_api.cpp')
-rw-r--r-- | source/blender/imbuf/intern/oiio/openimageio_api.cpp | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp index 838343dce35..fe74b8f7cce 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp +++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp @@ -98,11 +98,20 @@ static ImBuf *imb_oiio_load_image(ImageInput *in, int width, int height, int com try { - in->read_image(TypeDesc::UINT8, - (uchar *)ibuf->rect + (height - 1) * scanlinesize, - AutoStride, - -scanlinesize, - AutoStride); + if (!in->read_image(TypeDesc::UINT8, + (uchar *)ibuf->rect + (height - 1) * scanlinesize, + AutoStride, + -scanlinesize, + AutoStride)) + { + std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl + << in->geterror() << std::endl; + + if (ibuf) + IMB_freeImBuf(ibuf); + + return NULL; + } } catch (const std::exception &exc) { @@ -128,11 +137,20 @@ static ImBuf *imb_oiio_load_image_float(ImageInput *in, int width, int height, i try { - in->read_image(TypeDesc::FLOAT, - (uchar *)ibuf->rect_float + (height - 1) * scanlinesize, - AutoStride, - -scanlinesize, - AutoStride); + if (!in->read_image(TypeDesc::FLOAT, + (uchar *)ibuf->rect_float + (height - 1) * scanlinesize, + AutoStride, + -scanlinesize, + AutoStride)) + { + std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl + << in->geterror() << std::endl; + + if (ibuf) + IMB_freeImBuf(ibuf); + + return NULL; + } } catch (const std::exception &exc) { @@ -191,12 +209,18 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); in = ImageInput::create(filename); - if (!in) return NULL; + if (!in) { + std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl + << OpenImageIO::geterror() << std::endl; + return NULL; + } ImageSpec spec, config; config.attribute("oiio:UnassociatedAlpha", (int) 1); if (!in->open(filename, spec, config)) { + std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl + << in->geterror() << std::endl; delete in; return NULL; } |