From 04af7409648f2f775a76a54567a5b60996629d4c Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 9 Oct 2026 16:36:49 -0400 Subject: [PATCH] modatv: Prevent unsafe copying of ATVModSource Explicitly delete the copy constructor and copy assignment operator for ATVModSource, which manages resources that should not be shared through implicit shallow copies. The implicitly generated copy operations could leave multiple ATVModSource instances referring to the same resources, potentially causing invalid ownership or double deletion. Since ATVModSource is not intended to be copied or assigned, prohibit both operations at compile time, turning potential runtime errors into compile-time errors. cppcheck identified the missing copy constructor and assignment operator with its noCopyConstructor and noOperatorEq warnings. Signed-off-by: Robin Getz --- plugins/channeltx/modatv/atvmodsource.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/channeltx/modatv/atvmodsource.h b/plugins/channeltx/modatv/atvmodsource.h index 74e79e42f..4c3b6cb1f 100644 --- a/plugins/channeltx/modatv/atvmodsource.h +++ b/plugins/channeltx/modatv/atvmodsource.h @@ -46,6 +46,9 @@ class ATVModSource : public ChannelSampleSource public: ATVModSource(); ~ATVModSource(); + ATVModSource(const ATVModSource&) = delete; + ATVModSource& operator=(const ATVModSource&) = delete; + virtual void pull(SampleVector::iterator begin, unsigned int nbSamples); virtual void pullOne(Sample& sample);