changeset 4347:a188a94e1b61 libavcodec

Buffer for get_bits must be padded because readers may overread.
author reimar
date Sun, 14 Jan 2007 16:11:10 +0000
parents 855350bd0daf
children d3dcf62d52c5
files mpc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpc.c	Sat Jan 13 02:45:05 2007 +0000
+++ b/mpc.c	Sun Jan 14 16:11:10 2007 +0000
@@ -231,7 +231,7 @@
         av_log(avctx, AV_LOG_ERROR, "Too small buffer passed (%i bytes)\n", buf_size);
     }
 
-    bits = av_malloc((buf_size - 1) & ~3);
+    bits = av_malloc(((buf_size - 1) & ~3) + FF_INPUT_BUFFER_PADDING_SIZE);
     c->dsp.bswap_buf(bits, buf + 4, (buf_size - 4) >> 2);
     init_get_bits(&gb, bits, (buf_size - 4)* 8);
     skip_bits(&gb, buf[0]);