Fix error in high bit-depth image tile drawing

From @1xundoredo in D2824
This commit is contained in:
Campbell Barton 2017-09-06 16:08:01 +10:00
parent 0fd31c53ee
commit 47b7f06d0e
Notes: blender-bot 2023-02-14 06:35:58 +01:00
Referenced by issue #52663, SEGV when D.images.remove(D.images[0], do_unlink=True)
1 changed files with 2 additions and 2 deletions

View 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 {