Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-03-19 17:23:08 +0300
committerJeroen Bakker <jeroen@blender.org>2020-03-19 17:26:53 +0300
commit2982c9ba0a9c2152cb676bc4bb71a319f8f18ad8 (patch)
treea99280e75c6673072f201cb8e98dc44d6fdf037a
parent9ace7e2439781457bed40994519a26cd22e63a78 (diff)
ColorManagement: Incorrect Memory Read for RGB images
When RGB images or BW images are converted to a GPU texture and color space conversion was needed the images were read incorrectly. This patch checks the correct amount of channels in the image and uses that as the correct pixel stride.
-rw-r--r--source/blender/imbuf/intern/colormanagement.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 2a458ba5474..a95db5c1de4 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2293,7 +2293,7 @@ void IMB_colormanagement_imbuf_to_float_texture(float *out_buffer,
for (int y = 0; y < height; y++) {
const size_t in_offset = (offset_y + y) * ibuf->x + offset_x;
const size_t out_offset = y * width;
- const float *in = in_buffer + in_offset * 4;
+ const float *in = in_buffer + in_offset * in_channels;
float *out = out_buffer + out_offset * 4;
if (in_channels == 1) {