/haiku/src/libs/icon/generic/ |
H A D | VertexSource.h | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|
/haiku/src/libs/icon/transformer/ |
H A D | PathTransformer.h | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|
H A D | PerspectiveTransformer.cpp | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|
H A D | ContourTransformer.cpp | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|
H A D | AffineTransformer.cpp | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|
H A D | StrokeTransformer.cpp | 0822ec27a9fde7fac91a39214286c5d0d0eeb154 Tue Oct 17 14:04:51 UTC 2023 PulkoMandy <pulkomandy@pulkomandy.tk> libicon: Fix dangling references to VertexSource in PathTransformer
PathTransformer keeps a reference to the VertexSource used (which can be either another PathTransformer, or the base path for a shape). When a shape is cloned, this should be retargetted to the new object in the clone.
However, references are not settable, and so, what would happen instead is the original (non-cloned) vertex source was reinitialized (through the default implementation of the assignment operator) using data from the clone, and the clone would still point to it. Then, if the original object is deleted, the clone would point to freed memory.
To avoid this problem, replace the reference with a pointer (which can be set to point elsewhere, as the code intended to do). To make sure this does not happen again, make the VertexSource copy constructor and assignment operator private, and deleted when the compiler supports that.
Fixes #18577
Change-Id: I8870d9471c5064e922a84eff8447cbda783b13e6 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7052 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
|