Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2010-01-08 05:45:51 +0300
committerMartin Poirier <theeth@yahoo.com>2010-01-08 05:45:51 +0300
commitbb5f8bd0af6521ddc6091d3276fb6c1728a737bc (patch)
tree5830267bc83c7e41ece51465f1fc8329e8fee22a /source/blender/makesrna
parentef8179f7cb28f2c3fb65961b91881ced6ace343c (diff)
Image RNA api: Don't crash if can't acquire buffer from image when saving image to disk.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 497891a4de8..b8be2da4579 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -77,9 +77,11 @@ static void rna_Image_save(Image *image, bContext *C, ReportList *reports, char
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 {