mirror of
https://github.com/mpv-player/mpv
synced 2024-12-30 19:22:11 +00:00
Avoid releasing of unallocated memory.
Patch is made from coreavc-for-linux project source code http://code.google.com/p/coreavc-for-linux/ git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24367 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0efbf8149c
commit
cf5ef1660a
@ -82,6 +82,7 @@ void CMediaSample_Destroy(CMediaSample* This)
|
||||
Debug printf("CMediaSample_Destroy(%p) called (ref:%d)\n", This, This->refcount);
|
||||
free(This->vt);
|
||||
free(This->own_block);
|
||||
if(((CMediaSample*)This)->type_valid)
|
||||
FreeMediaType(&(This->media_type));
|
||||
free(This);
|
||||
}
|
||||
@ -375,6 +376,7 @@ static HRESULT STDCALL CMediaSample_SetMediaType(IMediaSample * This,
|
||||
if (!pMediaType)
|
||||
return E_INVALIDARG;
|
||||
t = &((CMediaSample*)This)->media_type;
|
||||
if(((CMediaSample*)This)->type_valid)
|
||||
FreeMediaType(t);
|
||||
CopyMediaType(t,pMediaType);
|
||||
((CMediaSample*) This)->type_valid=1;
|
||||
|
Loading…
Reference in New Issue
Block a user