diff libmpdemux/demuxer.h @ 7776:75c5762e7b55

fill the extra bytes with zero
author arpi
date Thu, 17 Oct 2002 00:54:13 +0000
parents 18f7389bc822
children 2b39ff3860b7
line wrap: on
line diff
--- a/libmpdemux/demuxer.h	Thu Oct 17 00:53:14 2002 +0000
+++ b/libmpdemux/demuxer.h	Thu Oct 17 00:54:13 2002 +0000
@@ -130,13 +130,14 @@
 inline static demux_packet_t* new_demux_packet(int len){
   demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
   dp->len=len;
-  dp->buffer=len?(unsigned char*)malloc(len+8):NULL;
   dp->next=NULL;
   dp->pts=0;
   dp->pos=0;
   dp->flags=0;
   dp->refcount=1;
   dp->master=NULL;
+  dp->buffer=len?(unsigned char*)malloc(len+8):NULL;
+  if(len) memset(dp->buffer+len,0,8);
   return dp;
 }