diff options
author | 2007-09-08 12:15:15 +0000 | |
---|---|---|
committer | 2007-09-08 12:15:15 +0000 | |
commit | cf5ef1660af60432cbb7e09a6d467b531bc5d06e (patch) | |
tree | 349ccc6aed95d22863d8786dc782da602a39fb70 | |
parent | 0efbf8149c0f4c9aceb799aecf04e3afc66bc423 (diff) |
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
-rw-r--r-- | loader/dshow/cmediasample.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/loader/dshow/cmediasample.c b/loader/dshow/cmediasample.c index 7e861023de..e4431162ce 100644 --- a/loader/dshow/cmediasample.c +++ b/loader/dshow/cmediasample.c @@ -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; |