Commit 4300981d authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Don't crash if parent is NULL in AMAudioStream:: and…

amstream: Don't crash if parent is NULL in AMAudioStream:: and AMDirectDrawStream::GetMultiMediaStream. Signed-off-by: 's avatarAnton Baskanov <baskanov@gmail.com> Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f5aaca10
...@@ -429,18 +429,18 @@ static ULONG WINAPI audio_IAMMediaStream_Release(IAMMediaStream *iface) ...@@ -429,18 +429,18 @@ static ULONG WINAPI audio_IAMMediaStream_Release(IAMMediaStream *iface)
/*** IMediaStream methods ***/ /*** IMediaStream methods ***/
static HRESULT WINAPI audio_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface, static HRESULT WINAPI audio_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface,
IMultiMediaStream** multi_media_stream) IMultiMediaStream **mmstream)
{ {
struct audio_stream *This = impl_from_IAMMediaStream(iface); struct audio_stream *stream = impl_from_IAMMediaStream(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, multi_media_stream); TRACE("stream %p, mmstream %p.\n", stream, mmstream);
if (!multi_media_stream) if (!mmstream)
return E_POINTER; return E_POINTER;
IMultiMediaStream_AddRef(This->parent); if (stream->parent)
*multi_media_stream = This->parent; IMultiMediaStream_AddRef(stream->parent);
*mmstream = stream->parent;
return S_OK; return S_OK;
} }
......
...@@ -125,18 +125,18 @@ static ULONG WINAPI ddraw_IAMMediaStream_Release(IAMMediaStream *iface) ...@@ -125,18 +125,18 @@ static ULONG WINAPI ddraw_IAMMediaStream_Release(IAMMediaStream *iface)
/*** IMediaStream methods ***/ /*** IMediaStream methods ***/
static HRESULT WINAPI ddraw_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface, static HRESULT WINAPI ddraw_IAMMediaStream_GetMultiMediaStream(IAMMediaStream *iface,
IMultiMediaStream** multi_media_stream) IMultiMediaStream **mmstream)
{ {
struct ddraw_stream *This = impl_from_IAMMediaStream(iface); struct ddraw_stream *stream = impl_from_IAMMediaStream(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, multi_media_stream); TRACE("stream %p, mmstream %p.\n", stream, mmstream);
if (!multi_media_stream) if (!mmstream)
return E_POINTER; return E_POINTER;
IMultiMediaStream_AddRef(This->parent); if (stream->parent)
*multi_media_stream = This->parent; IMultiMediaStream_AddRef(stream->parent);
*mmstream = stream->parent;
return S_OK; return S_OK;
} }
......
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