changeset 5302:6dc0ac26eb0e

eeh 10l, forgot malloc of esds struct.
author atmos4
date Sun, 24 Mar 2002 02:38:20 +0000
parents d72c3169a343
children 534f16f50c17
files libmpdemux/demux_mov.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Sun Mar 24 02:25:41 2002 +0000
+++ b/libmpdemux/demux_mov.c	Sun Mar 24 02:38:20 2002 +0000
@@ -704,9 +704,9 @@
 		    int atom_len = char2int(trak->stdata,28);
 		    switch(char2int(trak->stdata,32)) { // atom type
 		      case MOV_FOURCC('e','s','d','s'): {
-			esds_t *esds; 				  
 			mp_msg(MSGT_DEMUX, MSGL_INFO, "MOV: Found MPEG4 audio Elementary Stream Descriptor atom (%d)!\n", atom_len);
 			if(atom_len >= 8) {
+			  esds_t *esds = (esds_t *)malloc(sizeof(esds_t)); 				  
 			  if(!mp4_parse_esds(&trak->stdata[36], atom_len-8, esds)) {
 			    
 			    sh->i_bps = esds->avgBitrate/8; 
@@ -716,6 +716,7 @@
 			    sh->codecdata = (unsigned char *)malloc(sh->codecdata_len);
 			    memcpy(sh->codecdata, esds->decoderConfig, sh->codecdata_len);
 			  }
+			  free(esds);
 #if 0
 	  		  { FILE* f=fopen("esds.dat","wb");
 			  fwrite(&trak->stdata[36],atom_len-8,1,f);