diff options
author | John Brooks <john.brooks@theqtcompany.com> | 2015-11-06 14:15:57 -0800 |
---|---|---|
committer | John Brooks <john.brooks@dereferenced.net> | 2015-11-19 23:36:39 +0000 |
commit | 5c09c4c3c7794fd49d64dc3429d157f1a4bb5a72 (patch) | |
tree | f3d0737b4edd51cd0945f24dd7a38c157021e9c4 /src/plugins/avfoundation/camera/avfcameraservice.mm | |
parent | b80436a3e0c0b4a28cd8b88d73ec897df52a8de2 (diff) |
Fix use-after-free in AVFCameraService during renderer destruction
Change-Id: I10a994b71e55565c0de31aa0c34f32964e2e3a1b
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'src/plugins/avfoundation/camera/avfcameraservice.mm')
-rw-r--r-- | src/plugins/avfoundation/camera/avfcameraservice.mm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm index fd473b37b..20156f06f 100644 --- a/src/plugins/avfoundation/camera/avfcameraservice.mm +++ b/src/plugins/avfoundation/camera/avfcameraservice.mm @@ -203,18 +203,15 @@ QMediaControl *AVFCameraService::requestControl(const char *name) void AVFCameraService::releaseControl(QMediaControl *control) { - if (m_videoOutput == control) { - m_session->setVideoOutput(0); - delete m_videoOutput; - m_videoOutput = 0; - } AVFMediaVideoProbeControl *videoProbe = qobject_cast<AVFMediaVideoProbeControl *>(control); if (videoProbe) { m_session->removeProbe(videoProbe); delete videoProbe; - return; + } else if (m_videoOutput == control) { + m_session->setVideoOutput(0); + delete m_videoOutput; + m_videoOutput = 0; } - } AVFMediaRecorderControl *AVFCameraService::recorderControl() const |