[Bf-blender-cvs] [4789793] master: Fix for bad imbuf creation by compositor viewers if resolution is (0, 0).

Lukas Tönne noreply at git.blender.org
Thu Feb 20 12:14:45 CET 2014


Commit: 4789793f0903fe0ce9daa30c013a4fccf4971e89
Author: Lukas Tönne
Date:   Thu Feb 20 12:07:34 2014 +0100
https://developer.blender.org/rB4789793f0903fe0ce9daa30c013a4fccf4971e89

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.

===================================================================

M	source/blender/compositor/operations/COM_ViewerOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index f53f2b8..c54a497 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;




More information about the Bf-blender-cvs mailing list