Edit Mesh Selection: Clear buffer before using in glReadPixel.
authormano-wii <germano.costa@ig.com.br>
Wed, 27 Mar 2019 23:33:25 +0000 (20:33 -0300)
committermano-wii <germano.costa@ig.com.br>
Wed, 27 Mar 2019 23:34:05 +0000 (20:34 -0300)
Areas out of bound are not written.

source/blender/editors/space_view3d/view3d_draw_legacy.c

index 454315afa57d5372fc4f73682459fe527dbe3767..9498f007910c942acb5843647c4dcfba4fd08741 100644 (file)
@@ -303,7 +303,7 @@ uint *ED_view3d_select_id_read_rect(ViewContext *vc, const rcti *clip, uint *r_b
        uint width = BLI_rcti_size_x(clip);
        uint height = BLI_rcti_size_y(clip);
        uint buf_len = width * height;
-       uint *buf = MEM_mallocN(buf_len * sizeof(*buf), __func__);
+       uint *buf = MEM_callocN(buf_len * sizeof(*buf), __func__);
 
        DRW_framebuffer_select_id_read(clip, buf);