changeset 11389:7b9896e85410 libavcodec

Increase FF_INPUT_BUFFER_PADDING_SIZE to 64. The purpose of this is to give decoders a reasonable amount of buffer to work with before needing to check for overreads.
author alexc
date Sun, 07 Mar 2010 21:16:44 +0000
parents 404629a45da1
children 4a8900c06c67
files avcodec.h
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Sun Mar 07 21:07:22 2010 +0000
+++ b/avcodec.h	Sun Mar 07 21:16:44 2010 +0000
@@ -424,12 +424,14 @@
 
 /**
  * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
+ * The first 8 bytes are needed because some optimized bitstream readers read
+ * 32 or 64 bit at once and could read over the end. The remainder is to give
+ * decoders a reasonable amount of distance to work with before checking for
+ * buffer overreads.<br>
  * Note: If the first 23 bits of the additional bytes are not 0, then damaged
  * MPEG bitstreams could cause overread and segfault.
  */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
+#define FF_INPUT_BUFFER_PADDING_SIZE 64
 
 /**
  * minimum encoding buffer size