diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-17 07:02:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-17 07:02:19 +0300 |
commit | f791d74f102dcfed69a95d605e3c634f76a070ab (patch) | |
tree | bf41ae1a585bb585891eb11ff5f0bd16abf2ffb6 /source | |
parent | 02bbce8b6d7bc1281076e59a0837dd9fadf56d33 (diff) |
writing single images from a render (own commit r33104), wasn't checking if the render was cancelled which would crash when writing the image.
also remove paranoid checks for writing TAGA, Other formats - BMP, JPEG, Iris don't do this.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 9 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 24 |
2 files changed, 13 insertions, 20 deletions
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 89a69242a46..bc88f2bed0d 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -235,19 +235,12 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file) int imb_savetarga(struct ImBuf * ibuf, char *name, int flags) { - char buf[20]; + char buf[20]= {0}; FILE *fildes; short ok = 0; (void)flags; /* unused */ - if (ibuf == 0) return (0); - if (ibuf->rect == 0) return (0); - - memset(buf,0,sizeof(buf)); - - /* buf[0] = 0; length string */ - buf[16] = (ibuf->depth + 0x7 ) & ~0x7; if (ibuf->depth > 8 ){ buf[2] = 10; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 5cd0e09fdf4..c7b8792961b 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2855,19 +2855,19 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr if(render_initialize_from_main(re, bmain, scene, srl, lay, 0, 0)) { MEM_reset_peak_memory(); do_render_all_options(re); - } - - if(write_still) { - if(BKE_imtype_is_movie(scene->r.imtype)) { - /* operator checks this but incase its called from elsewhere */ - printf("Error: cant write single images with a movie format!\n"); - } - else { - char name[FILE_MAX]; - BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE); - /* reports only used for Movie */ - do_write_image_or_movie(re, scene, NULL, NULL, name); + if(write_still && !G.afbreek) { + if(BKE_imtype_is_movie(scene->r.imtype)) { + /* operator checks this but incase its called from elsewhere */ + printf("Error: cant write single images with a movie format!\n"); + } + else { + char name[FILE_MAX]; + BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION, FALSE); + + /* reports only used for Movie */ + do_write_image_or_movie(re, scene, NULL, NULL, name); + } } } |