summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_real.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demux_real.c')
-rw-r--r--libmpdemux/demux_real.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c
index 0d6ce85a75..5348c06b19 100644
--- a/libmpdemux/demux_real.c
+++ b/libmpdemux/demux_real.c
@@ -32,6 +32,12 @@ Video codecs: (supported by RealPlayer8 for Linux)
#include "stheader.h"
#include "bswap.h"
+#ifdef USE_LIBAVCODEC
+#include "avcodec.h"
+#else
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
+#endif
+
//#define mp_dbg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
#define MKTAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24))
@@ -921,7 +927,8 @@ got_video:
// increase buffer size, this should not happen!
mp_msg(MSGT_DEMUX,MSGL_WARN, "chunktab buffer too small!!!!!\n");
dp->len=dp_hdr->chunktab+8*(4+dp_hdr->chunks);
- dp->buffer=realloc(dp->buffer,dp->len);
+ dp->buffer=realloc(dp->buffer,dp->len+FF_INPUT_BUFFER_PADDING_SIZE);
+ memset(dp->buffer + dp->len, 0, FF_INPUT_BUFFER_PADDING_SIZE);
// re-calc pointers:
dp_hdr=(dp_hdr_t*)dp->buffer;
dp_data=dp->buffer+sizeof(dp_hdr_t);