diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-08 17:41:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-08 17:41:36 +0200 |
commit | 57d9c96d96d818f19d34d4930cc8ffc8c24e43e2 (patch) | |
tree | 79f6230c0c131327b57e26c1db639cdeb2311860 /drawinglayer | |
parent | ccd2240332f2e70e08f62e349176fab03297c39f (diff) |
fdo#70090: Avoid race in copy vs. modification of aRetval Sequence
If, in the original code, aRetval[0] was computed before calling
new MaskPrmitive2D (as apparently happens with Clang), no COW-copy of aRetval's
internals was created (as the refcount was still 1), so MaskPrimitive2D's
maChildren would share the Sequence internals with aRetval, so would end up
having itself as its children after the assignment.
Change-Id: I145ca429fdfae2ea555b8c754b407a81b989d45b
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 42da7531f96d..91c5cae75a5a 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -304,9 +304,10 @@ namespace drawinglayer basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon()); aMaskPolygon.transform(rTransform); - aRetval[0] = new MaskPrimitive2D( + Primitive2DReference mask = new MaskPrimitive2D( basegfx::B2DPolyPolygon(aMaskPolygon), aRetval); + aRetval[0] = mask; } break; } |