[MPlayer-dev-eng] [PATCH] Wrong typecast in loader/dshow/output.c

Roberto Togni rxt at rtogni.it
Sat Feb 10 16:00:53 CET 2007

On Sun, 28 Jan 2007 02:03:10 +0600
"Vladimir Voroshilov" <voroshil at gmail.com> wrote:

> COutputMemPin_Queryinterface belongs to COutputMemPin, but casts This
> parameter as COutputPin. This does not affect until DirectShow call
> QueryInterface to retrive IMemInputPin from COutputMemPin. For
> example:
> Example1:
> pPin->vt->QueryInterface(pPin,&IID_IMemInputPin,&pMemPin1); // FINE
> pPin->vt->QueryInterface(pPin,&IID_IMemInputPin,&pMemPin2); // FINE
> Example2:
> pPin->vt->QueryInterface(pPin,&IID_IMemInputPin,&pMemPin1); // FINE
> pMemPin1->vt->QueryInterface(pMemPin1,&IID_IMemInputPin,&pMemPin2);
> //Should crash
> Seem like DirectShow binary codecs usually does not query IMemInputPin
> interface from IMemInputPin and thus all works fine.
> Attached patch fixes this bug.
> I have tested it under Linux with divxds dshow codec and all works fine.
> Opinions?

Untested, but looks ok.

Do you have some codec that requires this function, or are you fixing
it just because you noticed the bug while looking at the code?


More information about the MPlayer-dev-eng mailing list