[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25823] trunk/blender/source/blender/ makesrna/intern/rna_image_api.c: Image RNA api: Don't crash if can' t acquire buffer from image when saving image to disk.
Martin Poirier
theeth at yahoo.com
Fri Jan 8 03:45:52 CET 2010
Revision: 25823
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25823
Author: theeth
Date: 2010-01-08 03:45:51 +0100 (Fri, 08 Jan 2010)
Log Message:
-----------
Image RNA api: Don't crash if can't acquire buffer from image when saving image to disk.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_image_api.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_image_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_image_api.c 2010-01-08 02:33:20 UTC (rev 25822)
+++ trunk/blender/source/blender/makesrna/intern/rna_image_api.c 2010-01-08 02:45:51 UTC (rev 25823)
@@ -77,9 +77,11 @@
ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
- if (BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) {
- /* save successful */
- } else {
+ if (ibuf == NULL) {
+ BKE_reportf(reports, RPT_ERROR, "Couldn't acquire buffer from image");
+ }
+
+ if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
}
} else {
More information about the Bf-blender-cvs
mailing list