Revision: 19846
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19846
Author:   ton
Date:     2009-04-21 15:30:58 +0200 (Tue, 21 Apr 2009)

Log Message:
-----------
Bugfix #18519

MultiLayer save (F3) crashes when no rendering/layers exist, happens for
opengl preview render. It now survives, saving empty file and prints error.

Better solution for later: render profiles!

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp

Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp   
2009-04-21 13:30:12 UTC (rev 19845)
+++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp   
2009-04-21 13:30:58 UTC (rev 19846)
@@ -570,13 +570,17 @@
        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)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to