summaryrefslogtreecommitdiffstats
path: root/demux/demux_asf.c
diff options
context:
space:
mode:
Diffstat (limited to 'demux/demux_asf.c')
-rw-r--r--demux/demux_asf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/demux/demux_asf.c b/demux/demux_asf.c
index 1d181eac67..0b8da6930f 100644
--- a/demux/demux_asf.c
+++ b/demux/demux_asf.c
@@ -100,11 +100,9 @@ static void init_priv (struct asf_priv* asf){
static void demux_asf_append_to_packet(demux_packet_t* dp,unsigned char *data,int len,int offs)
{
if(dp->len!=offs && offs!=-1) mp_msg(MSGT_DEMUX,MSGL_V,"warning! fragment.len=%d BUT next fragment offset=%d \n",dp->len,offs);
- dp->buffer=realloc(dp->buffer,dp->len+len+MP_INPUT_BUFFER_PADDING_SIZE);
- memcpy(dp->buffer+dp->len,data,len);
- memset(dp->buffer+dp->len+len, 0, MP_INPUT_BUFFER_PADDING_SIZE);
- mp_dbg(MSGT_DEMUX,MSGL_DBG4,"data appended! %d+%d\n",dp->len,len);
- dp->len+=len;
+ size_t old_len = dp->len;
+ resize_demux_packet(dp, dp->len + len);
+ memcpy(dp->buffer + old_len, data, len);
}
static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,int id,int seq,uint64_t time,unsigned short dur,int offs,int keyframe){