Commit 314f9b33 by Corentin Wallez

FramebufferAttachment: do not attach with an uninitialized mResource

Otherwise attach will try to call onDetach on mResource, causing an UB (and a segfault in most cases). This fixes a crash when running angle_unittests on Mac with another patch. BUG=angleproject:891 Change-Id: I09d34d7246849059a13bc2fb00a61837cccd97d7 Reviewed-on: https://chromium-review.googlesource.com/294830Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent b5d61dac
......@@ -64,6 +64,7 @@ FramebufferAttachment::FramebufferAttachment(GLenum type,
}
FramebufferAttachment::FramebufferAttachment(const FramebufferAttachment &other)
: mResource(nullptr)
{
attach(other.mType, other.mTarget.binding(), other.mTarget.textureIndex(), other.mResource);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment