From 0b61eeddb54e4a22b0072de36b2ee1811d6aad8c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 9 May 2019 20:56:14 +0200 Subject: [PATCH] capmt: avoid use cam after delete Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7c375c27783b84d669e39845485344cb6f8847c Author: Jacek Jendrzej Date: 2019-05-09 (Thu, 09 May 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/capmt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp index 9e81dbd2e..8d4351a37 100644 --- a/src/zapit/src/capmt.cpp +++ b/src/zapit/src/capmt.cpp @@ -296,7 +296,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start cam->sendMessage(NULL, 0, false); /* clean up channel_map with stopped record/stream/pip services NOT live-tv */ it = channel_map.find(channel_id); - if(it != channel_map.end() && newmask != 0) + if(it != channel_map.end() && newmask != 0 && it->second != cam) { delete it->second; channel_map.erase(channel_id);