changeset 24347:89347ff2c31a

Avoid releasing of unallocated memory. Patch is made from coreavc-for-linux project source code http://code.google.com/p/coreavc-for-linux/
author voroshil
date Sat, 08 Sep 2007 12:15:15 +0000
parents 9fb68e85180a
children f96e42d494f9
files loader/dshow/cmediasample.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/loader/dshow/cmediasample.c	Sat Sep 08 10:15:08 2007 +0000
+++ b/loader/dshow/cmediasample.c	Sat Sep 08 12:15:15 2007 +0000
@@ -82,6 +82,7 @@
     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 @@
     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;