diff options
Diffstat (limited to 'source/blender/imbuf/intern/openexr/openexr_api.cpp')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index e723609f3ae..32d97d79bd7 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -570,13 +570,17 @@ void IMB_exr_write_channels(void *handle) FrameBuffer frameBuffer; ExrChannel *echan; - for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) - frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, - echan->xstride*sizeof(float), echan->ystride*sizeof(float))); - - data->ofile->setFrameBuffer (frameBuffer); - data->ofile->writePixels (data->height); - + if(data->channels.first) { + for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) + frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, + echan->xstride*sizeof(float), echan->ystride*sizeof(float))); + + data->ofile->setFrameBuffer (frameBuffer); + data->ofile->writePixels (data->height); + } + else { + printf("Error: attempt to save MultiLayer without layers.\n"); + } } void IMB_exr_read_channels(void *handle) @@ -861,6 +865,7 @@ static const char *exr_rgba_channelname(InputFile *file, const char *chan) for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) { + /* const Channel &channel = i.channel(); */ /* Not used yet */ const char *str= i.name(); int len= strlen(str); if(len) { |