Make sure integer calculation uses large precision
authorAntony Riakiotakis <kalast@gmail.com>
Wed, 29 Apr 2015 16:49:38 +0000 (18:49 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Wed, 29 Apr 2015 16:49:50 +0000 (18:49 +0200)
source/blender/render/intern/source/render_result.c

index c8ca1105417f7a750253dfe6b128b2819884283e..2baf445466cfbc488da0e4d31d03c7a629e4687b 100644 (file)
@@ -486,7 +486,7 @@ static RenderPass *render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int
        const size_t view_id = BLI_findstringindex(&rr->views, viewname, offsetof(RenderView, name));
        const char *typestr = name_from_passtype(passtype, -1);
        RenderPass *rpass = MEM_callocN(sizeof(RenderPass), typestr);
-       size_t rectsize = rr->rectx * rr->recty * channels;
+       size_t rectsize = ((size_t)rr->rectx) * ((size_t)rr->recty) * ((size_t)channels);
        
        BLI_addtail(&rl->passes, rpass);
        rpass->passtype = passtype;