diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-01-21 18:28:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-01-21 18:29:52 +0400 |
commit | 94325035f4fa0c45885194efb16eebc1af0d2d65 (patch) | |
tree | a7803b88bad3e97db5630ec12b596b88ea48f6b4 /source/blender/imbuf/intern/divers.c | |
parent | 8bcd8cb0bf024fd4f51111b2f1e4395fed0dd09d (diff) |
Fix T38298: crash saving float image with 3 channels from exr to png/jpeg.
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index e33f4d40b55..e147b810cfd 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -552,7 +552,8 @@ void IMB_rect_from_float(ImBuf *ibuf) IMB_colormanagement_transform(buffer, ibuf->x, ibuf->y, ibuf->channels, from_colorspace, ibuf->rect_colorspace->name, true); /* convert from float's premul alpha to byte's straight alpha */ - IMB_unpremultiply_rect_float(buffer, ibuf->planes, ibuf->x, ibuf->y); + if (ibuf->channels == 4) + IMB_unpremultiply_rect_float(buffer, ibuf->planes, ibuf->x, ibuf->y); /* convert float to byte */ IMB_buffer_byte_from_float((unsigned char *) ibuf->rect, buffer, ibuf->channels, ibuf->dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB, |