Fix for wrong boolean flag check
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Jan 2015 09:42:15 +0000 (14:42 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Jan 2015 09:43:18 +0000 (14:43 +0500)
This fixes obvious overflows when checking bitflags, who knows how much
undiscovered issues exists in the code still..

source/blender/editors/render/render_internal.c
source/blender/render/intern/source/convertblender.c

index fcc90fa57d542eca106be3f1bad9e57c90fbb041..b04f1d3e738152c794b81f2d1886f178d843109b 100644 (file)
@@ -1445,7 +1445,7 @@ static void render_view3d_do(RenderEngine *engine, const bContext *C)
        rp->bmain = CTX_data_main(C);
        rp->resolution_divider = divider;
        rp->start_resolution_divider = divider;
-       rp->has_freestyle = scene->r.mode & R_EDGE_FRS;
+       rp->has_freestyle = (scene->r.mode & R_EDGE_FRS) != 0;
        copy_m4_m4(rp->viewmat, rp->rv3d->viewmat);
        
        /* clear info text */
index 6437bbafe87646f9fcface2a34cfdb7502af8f33..c7170cfa4b4f4c6a57c962c469ccc0affa91a03a 100644 (file)
@@ -5235,7 +5235,7 @@ void RE_Database_Preprocess(Render *re)
                }
                
                if (!re->test_break(re->tbh))
-                       project_renderdata(re, projectverto, re->r.mode & R_PANORAMA, 0, 1);
+                       project_renderdata(re, projectverto, (re->r.mode & R_PANORAMA) != 0, 0, 1);
                
                /* Occlusion */
                if ((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
@@ -5333,7 +5333,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
        database_init_objects(re, lay, 0, 0, NULL, timeoffset);
        
        if (!re->test_break(re->tbh))
-               project_renderdata(re, projectverto, re->r.mode & R_PANORAMA, 0, 1);
+               project_renderdata(re, projectverto, (re->r.mode & R_PANORAMA) != 0, 0, 1);
 
        /* do this in end, particles for example need cfra */
        scene->r.cfra -= timeoffset;