manio / vdr-plugin-dvbapi

VDR dvbapi plugin for use with OSCam
http://www.streamboard.tv/wbb2/thread.php?threadid=40060
GNU General Public License v2.0
57 stars 25 forks source link

cDvbapiFilter::Analyze() segfault when more than 4 adapters #64

Closed nickb937 closed 9 years ago

nickb937 commented 10 years ago

DeCSA.h defines MAX_ADAPTERS to be 4

If I start VDR with parameters like "-D 0 -D 1 -D 2 -D 3 -D 6 -D 7", a segfault will occur in cDvbapiFilter::Analyze() if adapter 7 is chosen.

My quick fix is to increase MAX_ADAPTERS to 8.

Perhaps a better fix, which would be more memory efficient and remove the limitation would be to change the type of pidmap to be a std::map<std::pair<int, int>, std::vector>

The std::pair would be the representation of the <adapter_index, pid>

Or define:

class FilterIdx { int adapter; int pid; // Declare comparison functions. }

std::map<FilterIdx, std::vector>

manio commented 10 years ago

Thanks for your report. I am aware of this problem. It's on my to do list - to make it properly as some kind of dynamic structure, but I have to make sure it will not drop down the performance.

I don't know when I will fix it, so in the mean time please use your quick fix.