changeset 7776:75c5762e7b55

fill the extra bytes with zero
author arpi
date Thu, 17 Oct 2002 00:54:13 +0000
parents 87c94fd5719f
children ed7b05575aab
files libmpdemux/demuxer.h
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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;
 }