mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
videoio: fix segfault if CONVERT_RGB is false (issue #7465)
This commit is contained in:
parent
07711e404b
commit
df2b591896
@ -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…
Reference in New Issue
Block a user