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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-02-20 15:07:34 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-02-20 15:09:47 +0400
commit4789793f0903fe0ce9daa30c013a4fccf4971e89 (patch)
treef76096d316003864aa859519ef12e2881f393165 /source/blender/compositor
parent47c55c5d437c6ad628512f50fa53b7477c42938b (diff)
Fix for bad imbuf creation by compositor viewers if resolution is (0,0).
This can happen if no image buffers are used to define a sensible resolution. Then the viewer will stiff create a float buffer in the output imbuf, which defies the usual ibuf->rect_float check and leads to invalid memory access. Float buffer should not be created in this case.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index f53f2b87f98..c54a4971e54 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp
@@ -143,7 +143,9 @@ void ViewerOperation::initImage()
IMB_freezbuffloatImBuf(ibuf);
ibuf->x = getWidth();
ibuf->y = getHeight();
- imb_addrectfloatImBuf(ibuf);
+ /* zero size can happen if no image buffers exist to define a sensible resolution */
+ if (ibuf->x > 0 && ibuf->y > 0)
+ imb_addrectfloatImBuf(ibuf);
ima->ok = IMA_OK_LOADED;
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;