From 48d92e2c2e6291412e8a4d2218184112ebf0fad9 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sun, 18 Jan 2015 22:43:02 +0000 Subject: [PATCH] C++: Fix segfault where input/output options are NULL. --- bindings/cxx/classes.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 9dc003ac..bb709fe2 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -1388,12 +1388,15 @@ string InputFormat::description() map> InputFormat::options() { const struct sr_option **options = sr_input_options_get(_structure); - auto option_array = shared_ptr( - options, sr_input_options_free); map> result; - for (int i = 0; options[i]; i++) - result[options[i]->id] = shared_ptr