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

pull/7509/head
Guillaume Jacob 8 years ago
parent 07711e404b
commit df2b591896
  1. 2
      modules/videoio/src/cap_v4l.cpp

@ -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

Loading…
Cancel
Save