[MPlayer-cvslog] r24367 - trunk/loader/dshow/cmediasample.c

voroshil subversion at mplayerhq.hu
Sat Sep 8 14:15:15 CEST 2007


Author: voroshil
Date: Sat Sep  8 14:15:15 2007
New Revision: 24367

Log:
Avoid releasing of unallocated memory.

Patch is made from coreavc-for-linux project source code
http://code.google.com/coreavc-for-linux/



Modified:
   trunk/loader/dshow/cmediasample.c

Modified: trunk/loader/dshow/cmediasample.c
==============================================================================
--- trunk/loader/dshow/cmediasample.c	(original)
+++ trunk/loader/dshow/cmediasample.c	Sat Sep  8 14:15:15 2007
@@ -82,6 +82,7 @@ void CMediaSample_Destroy(CMediaSample* 
     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_SetM
     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;



More information about the MPlayer-cvslog mailing list