Fix use-after-free in AVFCameraService during renderer destruction
Change-Id: I10a994b71e55565c0de31aa0c34f32964e2e3a1b Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user