mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
win-dshow: Fix stack overflow bug
Martell changed this function without realizing that this was calling a function below it, not recursively calling itself. The reason why he got the warning was because there was no forward declaration of the function that was being called; I think he's used to C where only one function definition can exist with the same name. In this case, it was another function with the same name but with different parameters, something that's permitted in C++. I wish I had realized this sooner. This fixes the crashes people have been having with devices.
This commit is contained in:
@@ -569,10 +569,13 @@ static inline bool ResolutionValid(string res, int &cx, int &cy)
|
||||
return ConvertRes(cx, cy, res.c_str());
|
||||
}
|
||||
|
||||
template <typename ... F>
|
||||
static bool CapsMatch(const VideoDevice &dev, F ... fs);
|
||||
|
||||
template <typename F, typename ... Fs>
|
||||
static inline bool CapsMatch(const VideoInfo &info, F&& f, Fs ... fs)
|
||||
{
|
||||
return f(info) && CapsMatch(info, f, fs ...);
|
||||
return f(info) && CapsMatch(info, fs ...);
|
||||
}
|
||||
|
||||
static inline bool CapsMatch(const VideoInfo&)
|
||||
|
||||
Reference in New Issue
Block a user