Fix error in high bit-depth image tile drawing
authorCampbell Barton <ideasman42@gmail.com>
Wed, 6 Sep 2017 06:08:01 +0000 (16:08 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 6 Sep 2017 06:11:19 +0000 (16:11 +1000)
From @1xundoredo in D2824

source/blender/gpu/intern/gpu_draw.c

index 1583d16ca27ef8637e446dfca14ceca797cc3782..2d7fa760e49bdcb3df791ec8f8a96316bb758d1e 100644 (file)
@@ -682,10 +682,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 {