From 6f3503981a4f20ef3e939a9b91c29ef12d95efd2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 31 Jan 2019 20:47:39 +0200 Subject: cam: options: Store options in a list instead of a vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When option are added to the parser, they are stored in the OptionsParser::options_ vector, and a pointer to the option referencing the vector entry is indexed in the OptionsParser::optionsMap_ map. When the next option is added the vector may be resized, which invalidates the pointers stored in the map. Fix this by storing the options in an std::list<> instead of std::vector<>. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cam/options.h') diff --git a/src/cam/options.h b/src/cam/options.h index 2272385a..b9b7bd25 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -8,8 +8,8 @@ #define __CAM_OPTIONS_H__ #include +#include #include -#include enum OptionArgument { ArgumentNone, @@ -57,7 +57,7 @@ public: void usage(); private: - std::vector