OggDemuxPacketSourceFilter GetCurFile memory allocation causes crashes
Whoever wrote OggDemuxPacketSourceFilter GetCurFile did not read the docs in MSDN. The method should use CoTaskMemAlloc since the caller frees it with the CoTask.. As it is, if oggdsf is installed on the same system with a filter that a uses this method, it appears that the other filter crashes when it is infact oggdsf that is to blame.
Here's corrected code though that doesn't exhibit the crash.
STDMETHODIMP OggDemuxPacketSourceFilter::GetCurFile(LPOLESTR * outFileName, AM_MEDIA_TYPE *outMediaType) { CheckPointer(outFileName, E_POINTER); *outFileName = NULL; const wchar_t *m_pFileName = mFileName.c_str(); if (m_pFileName != NULL) { *outFileName = (LPOLESTR)CoTaskMemAlloc(sizeof(WCHAR) * (1+lstrlenW(m_pFileName))); if (*outFileName != NULL) { wcscpy(*outFileName, m_pFileName); } } if(outMediaType) { ZeroMemory(outMediaType, sizeof(*outMediaType)); outMediaType->majortype = MEDIATYPE_NULL; outMediaType->subtype = MEDIASUBTYPE_NULL; } return S_OK; }