Commit 3a9040c1 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Only query for event interface when there is a filtergraph.

Prevents a null pointer dereference.
parent e8705402
......@@ -568,16 +568,21 @@ static HRESULT WINAPI NullRenderer_InputPin_EndOfStream(IPin * iface)
{
InputPin* This = (InputPin*)iface;
IMediaEventSink* pEventSink;
HRESULT hr;
IFilterGraph *graph;
HRESULT hr = S_OK;
TRACE("(%p/%p)->()\n", This, iface);
InputPin_EndOfStream(iface);
hr = IFilterGraph_QueryInterface(((NullRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
if (SUCCEEDED(hr))
graph = ((NullRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph;
if (graph)
{
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
IMediaEventSink_Release(pEventSink);
hr = IFilterGraph_QueryInterface(((NullRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
if (SUCCEEDED(hr))
{
hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
IMediaEventSink_Release(pEventSink);
}
}
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment