Commit 3a3dfcbd authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #7509 from lpea:camv4l_segfault

parents 07711e40 df2b5918
......@@ -1849,7 +1849,7 @@ static void icvCloseCAM_V4L( CvCaptureCAM_V4L* capture ){
if (capture->deviceHandle != -1)
close(capture->deviceHandle);
if (capture->frame.imageData)
if (capture->frame_allocated && capture->frame.imageData)
cvFree(&capture->frame.imageData);
capture->deviceName.clear(); // flag that the capture is closed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment