changeset 25630:bdb0a9df0025

Codecdata must always be malloc'd, fixes free being called with an invalid pointer when freeing codecdata.
author reimar
date Wed, 09 Jan 2008 07:18:14 +0000
parents 2394a5196b42
children 88e81dc42cb8
files libmpdemux/demux_mov.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Wed Jan 09 03:38:47 2008 +0000
+++ b/libmpdemux/demux_mov.c	Wed Jan 09 07:18:14 2008 +0000
@@ -747,13 +747,15 @@
 		         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);
 		      }
 		    }
 		  }