handle edge-case where jack-meta-data may be NULL, but the call succeeds
authorRobin Gareus <robin@gareus.org>
Fri, 19 Aug 2016 12:38:22 +0000 (14:38 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 19 Aug 2016 12:38:37 +0000 (14:38 +0200)
this fixes #6968

libs/backends/jack/jack_portengine.cc

index 934f8b5d9e0cc583eb8686750c757f46610a2abe..98d2744d7a5856abf3213181beb66186cbff946f 100644 (file)
@@ -135,12 +135,15 @@ JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, st
        jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
        rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
 
-       if (0 == rv) {
+       if (0 == rv && cvalue && ctype) {
                value = cvalue;
                type = ctype;
-               jack_free(cvalue);
-               jack_free(ctype);
+       } else {
+               rv = -1;
        }
+
+       jack_free(cvalue);
+       jack_free(ctype);
        return rv;
 #else
        return -1;