[MPlayer-cvslog] r25658 - trunk/libmpdemux/demux_mov.c

reimar subversion at mplayerhq.hu
Wed Jan 9 08:18:14 CET 2008


Author: reimar
Date: Wed Jan  9 08:18:14 2008
New Revision: 25658

Log:
Codecdata must always be malloc'd, fixes free being called with an
invalid pointer when freeing codecdata.


Modified:
   trunk/libmpdemux/demux_mov.c

Modified: trunk/libmpdemux/demux_mov.c
==============================================================================
--- trunk/libmpdemux/demux_mov.c	(original)
+++ trunk/libmpdemux/demux_mov.c	Wed Jan  9 08:18:14 2008
@@ -747,13 +747,15 @@ static int gen_sh_audio(sh_audio_t* sh, 
 		         default:
 			  if (len > 8 && len + 44 <= trak->stdata_len) {
 				sh->codecdata_len = len-8;
-				sh->codecdata = trak->stdata+44+8;
+				sh->codecdata = malloc(sh->codecdata_len);
+				memcpy(sh->codecdata, trak->stdata+44+8, sh->codecdata_len);
 			  }
 		        }
 		    } else {
 		      if (len > 8 && len + 44 <= trak->stdata_len) {
 		    sh->codecdata_len = len-8;
-		    sh->codecdata = trak->stdata+44+8;
+		    sh->codecdata = malloc(sh->codecdata_len);
+		    memcpy(sh->codecdata, trak->stdata+44+8, sh->codecdata_len);
 		      }
 		    }
 		  }



More information about the MPlayer-cvslog mailing list