Commit df2b5918 authored by Guillaume Jacob's avatar Guillaume Jacob

videoio: fix segfault if CONVERT_RGB is false (issue #7465)

parent 07711e40
......@@ -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