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.
This commit is contained in:
Lukas Tönne 2014-02-20 12:07:34 +01:00
parent 47c55c5d43
commit 4789793f09
Notes: blender-bot 2023-02-14 11:09:41 +01:00
Referenced by issue #39577, Incorrect preview of mixed anisotropic shaders.
Referenced by issue #38984, Inconsistency using a pen tablet with continuous grab enabled.
Referenced by issue #38960, Sub-divide edge and pressing F6 key crashes blender.
Referenced by issue #38939, Bevel in edit mode.
Referenced by issue #38939, Bevel in edit mode.
Referenced by issue #38940, Hyperactive rigid bodies
Referenced by issue #38941, Laplacian Deform crashes on OSX
Referenced by issue #38913, Game engine crash with Arraymod + cap-object
Referenced by issue #38884, UI lists missing item edit text field in v2.70 test build
Referenced by issue #38854, crash adding new image in uv editor
Referenced by issue #38859, Laplacian Deform Crash When Parent With Automatic Weight
Referenced by issue #38843, Bone parallel to world z axis flicking when scale in edit mode.
Referenced by issue #38825, Missing "Mixdown" Button: compare 2.69.0 to 2.69.11
Referenced by issue #38810, Tabs and Ctrl+LMB unclear behaviour
Referenced by issue #38812, color picker not saving input when clicked away
Referenced by issue #38818, crashed when adding new image in UV editor
Referenced by issue #38776, Mr.
Referenced by issue #38766, Material transparency problems in solid viewport
Referenced by issue #38768, new "audio" button in 2.70 release does not 'mixdown' audio
Referenced by issue #38770, Vertex slide does not work on Blender 2.7 test build or newer versions
Referenced by issue #38771, 2 times slower BVH construction / render time with Hair system
Referenced by issue #38752, Mask scaling not working
Referenced by issue #38755, Blender 2.70 test build 1 suddenly closes without errors while opening .blend file
Referenced by issue #38756, Vertex Slide crippled functionality
Referenced by issue #38760, Multi-Number Button Editing doesn't work for dimensions fields
Referenced by issue #38741, UV/Image editor - Create new image --> Crash
1 changed files with 3 additions and 1 deletions

View File

@ -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;