mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 03:30:34 +08:00
Fixed segfault problem with cap_unicap (ticket #1112)
This commit is contained in:
parent
586ff429ec
commit
1564fe9a83
@ -149,12 +149,15 @@ bool CvCapture_Unicap::initDevice() {
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i = format.size_count - 1; i > 0; i--)
|
||||
if (format.sizes[i].width == desired_size.width &&
|
||||
format.sizes[i].height == desired_size.height)
|
||||
break;
|
||||
format.size.width = format.sizes[i].width;
|
||||
format.size.height = format.sizes[i].height;
|
||||
if (format.sizes)
|
||||
{
|
||||
for (i = format.size_count - 1; i > 0; i--)
|
||||
if (format.sizes[i].width == desired_size.width &&
|
||||
format.sizes[i].height == desired_size.height)
|
||||
break;
|
||||
format.size.width = format.sizes[i].width;
|
||||
format.size.height = format.sizes[i].height;
|
||||
}
|
||||
|
||||
if (!SUCCESS(unicap_set_format(handle, &format))) {
|
||||
shutdownDevice();
|
||||
|
Loading…
Reference in New Issue
Block a user