# HG changeset patch # User reimar # Date 1199863094 0 # Node ID bdb0a9df0025b5eb36a07248e6751a869bd89037 # Parent 2394a5196b428c8f83ccb3e1ce2120af007aa130 Codecdata must always be malloc'd, fixes free being called with an invalid pointer when freeing codecdata. diff -r 2394a5196b42 -r bdb0a9df0025 libmpdemux/demux_mov.c --- 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); } } }