Merge branch 'master' into blender2.8
[blender.git] / source / blender / gpu / intern / gpu_draw.c
index 601de2249f50d0811943c6b43c6daa4bc2872331..1ab1cba2504b74357cfbcbe55446de05d6c00fd9 100644 (file)
@@ -579,10 +579,10 @@ int GPU_verify_image(
                                if (do_color_management) {
                                        srgb_frect = MEM_mallocN(ibuf->x * ibuf->y * sizeof(float) * 4, "floar_buf_col_cor");
                                        gpu_verify_high_bit_srgb_buffer(srgb_frect, ibuf);
-                                       frect = srgb_frect + texwinsy * ibuf->x + texwinsx;
+                                       frect = srgb_frect + (4 * (texwinsy * ibuf->x + texwinsx));
                                }
                                else {
-                                       frect = ibuf->rect_float + texwinsy * ibuf->x + texwinsx;
+                                       frect = ibuf->rect_float + (ibuf->channels * (texwinsy * ibuf->x + texwinsx));
                                }
                        }
                        else {