瀏覽代碼

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.
jp9000 11 年之前
父節點
當前提交
7e0a86e583
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      plugins/win-dshow/win-dshow.cpp

+ 4 - 1
plugins/win-dshow/win-dshow.cpp

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