changeset 32601:f23e289e35c6

Fix insufficient padding/memset at the end of demuxer packets.
author reimar
date Sat, 11 Dec 2010 16:36:17 +0000
parents f418c82bd502
children 1cedf73225e0
files libmpdemux/demuxer.h
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.h	Sat Dec 11 15:49:09 2010 +0000
+++ b/libmpdemux/demuxer.h	Sat Dec 11 16:36:17 2010 +0000
@@ -293,7 +293,7 @@
   dp->master=NULL;
   dp->buffer=NULL;
   if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + MP_INPUT_BUFFER_PADDING_SIZE)))
-    memset(dp->buffer + len, 0, 8);
+    memset(dp->buffer + len, 0, MP_INPUT_BUFFER_PADDING_SIZE);
   else
     dp->len = 0;
   return dp;
@@ -303,7 +303,7 @@
 {
   if(len > 0)
   {
-     dp->buffer=(unsigned char *)realloc(dp->buffer,len+8);
+     dp->buffer=(unsigned char *)realloc(dp->buffer,len + MP_INPUT_BUFFER_PADDING_SIZE);
   }
   else
   {
@@ -312,7 +312,7 @@
   }
   dp->len=len;
   if (dp->buffer)
-     memset(dp->buffer + len, 0, 8);
+     memset(dp->buffer + len, 0, MP_INPUT_BUFFER_PADDING_SIZE);
   else
      dp->len = 0;
 }