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)
|
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);
|
AVFMediaVideoProbeControl *videoProbe = qobject_cast<AVFMediaVideoProbeControl *>(control);
|
||||||
if (videoProbe) {
|
if (videoProbe) {
|
||||||
m_session->removeProbe(videoProbe);
|
m_session->removeProbe(videoProbe);
|
||||||
delete videoProbe;
|
delete videoProbe;
|
||||||
return;
|
} else if (m_videoOutput == control) {
|
||||||
|
m_session->setVideoOutput(0);
|
||||||
|
delete m_videoOutput;
|
||||||
|
m_videoOutput = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AVFMediaRecorderControl *AVFCameraService::recorderControl() const
|
AVFMediaRecorderControl *AVFCameraService::recorderControl() const
|
||||||
|
|||||||
Reference in New Issue
Block a user