diff --git a/modules/videoio/src/cap_dshow.cpp b/modules/videoio/src/cap_dshow.cpp index d3abc3694f..175f1d0329 100644 --- a/modules/videoio/src/cap_dshow.cpp +++ b/modules/videoio/src/cap_dshow.cpp @@ -2503,7 +2503,10 @@ static void findClosestSizeAndSubtype(videoDevice * VD, int widthIn, int heightI int tempH = 999999; //Don't want to get stuck in a loop - if(stepX < 1 || stepY < 1) continue; + if(stepX < 1 || stepY < 1){ + MyDeleteMediaType(pmtConfig); + continue; + } //DebugPrintOut("min is %i %i max is %i %i - res is %i %i\n", scc.MinOutputSize.cx, scc.MinOutputSize.cy, scc.MaxOutputSize.cx, scc.MaxOutputSize.cy, stepX, stepY); //DebugPrintOut("min frame duration is %i max duration is %i\n", scc.MinFrameInterval, scc.MaxFrameInterval); @@ -2619,7 +2622,8 @@ static bool setSizeAndSubtype(videoDevice * VD, int attemptWidth, int attemptHei return true; }else{ VD->streamConf->SetFormat(tmpType); - if( tmpType != NULL )MyDeleteMediaType(tmpType); + if( VD->pAmMediaType != NULL)MyDeleteMediaType(VD->pAmMediaType); + VD->pAmMediaType = tmpType; } return false; diff --git a/samples/wp8/OcvImageManipulation/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs b/samples/wp8/OcvImageManipulation/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs index fd2a7c8466..73190e28f3 100644 --- a/samples/wp8/OcvImageManipulation/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs +++ b/samples/wp8/OcvImageManipulation/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs @@ -207,7 +207,7 @@ namespace PhoneXamlDirect3DApp1 catch { // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language + // ResourceLanguage not being correctly set to a supported language // code or ResourceFlowDirection is set to a value other than LeftToRight // or RightToLeft. @@ -220,4 +220,4 @@ namespace PhoneXamlDirect3DApp1 } } } -} \ No newline at end of file +} diff --git a/samples/wp8/OcvRotatingCube/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs b/samples/wp8/OcvRotatingCube/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs index fd2a7c8466..73190e28f3 100644 --- a/samples/wp8/OcvRotatingCube/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs +++ b/samples/wp8/OcvRotatingCube/PhoneXamlDirect3DApp1/PhoneXamlDirect3DApp1/App.xaml.cs @@ -207,7 +207,7 @@ namespace PhoneXamlDirect3DApp1 catch { // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language + // ResourceLanguage not being correctly set to a supported language // code or ResourceFlowDirection is set to a value other than LeftToRight // or RightToLeft. @@ -220,4 +220,4 @@ namespace PhoneXamlDirect3DApp1 } } } -} \ No newline at end of file +} diff --git a/samples/wp8/OpenCVXaml/OpenCVXaml/App.xaml.cs b/samples/wp8/OpenCVXaml/OpenCVXaml/App.xaml.cs index 6fe3a54410..17f8fed93e 100644 --- a/samples/wp8/OpenCVXaml/OpenCVXaml/App.xaml.cs +++ b/samples/wp8/OpenCVXaml/OpenCVXaml/App.xaml.cs @@ -207,7 +207,7 @@ namespace OpenCVXaml catch { // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language + // ResourceLanguage not being correctly set to a supported language // code or ResourceFlowDirection is set to a value other than LeftToRight // or RightToLeft. @@ -220,4 +220,4 @@ namespace OpenCVXaml } } } -} \ No newline at end of file +}