From 20866b8faaf4ed565d6197974712f26c22934a19 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Jun 2016 15:22:55 +0100 Subject: [PATCH] Added handling of null malloc --- src/osgPlugins/exr/ReaderWriterEXR.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgPlugins/exr/ReaderWriterEXR.cpp b/src/osgPlugins/exr/ReaderWriterEXR.cpp index 9cfc5bffb..caf47047e 100644 --- a/src/osgPlugins/exr/ReaderWriterEXR.cpp +++ b/src/osgPlugins/exr/ReaderWriterEXR.cpp @@ -146,6 +146,11 @@ unsigned char *exr_load(std::istream& fin, unsigned dataSize = (sizeof(half) * height * width * numComponents); //buffer = new unsigned char[dataSize]; buffer = (unsigned char*)malloc(dataSize); + if (!buffer) + { + OSG_WARN<<"Warning: exr_load() out of memory"<= 0; i--)