changeset 7624:545305ba44a0 libavcodec

rename AC3_MAX_FRAME_SIZE to AC3_FRAME_BUFFER_SIZE and increase the size
author jbr
date Wed, 20 Aug 2008 00:08:59 +0000
parents 0bd920dcb7a5
children da9353cd6d71
files ac3dec.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Tue Aug 19 20:52:26 2008 +0000
+++ b/ac3dec.c	Wed Aug 20 00:08:59 2008 +0000
@@ -37,8 +37,8 @@
 #include "ac3dec.h"
 #include "ac3dec_data.h"
 
-/** Maximum possible frame size when the specification limit is ignored */
-#define AC3_MAX_FRAME_SIZE 21695
+/** Large enough for maximum possible frame size when the specification limit is ignored */
+#define AC3_FRAME_BUFFER_SIZE 32768
 
 /**
  * table for ungrouping 3 values in 7 bits.
@@ -215,7 +215,7 @@
 
     /* allocate context input buffer */
     if (avctx->error_resilience >= FF_ER_CAREFUL) {
-        s->input_buffer = av_mallocz(AC3_MAX_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+        s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
         if (!s->input_buffer)
             return AVERROR_NOMEM;
     }
@@ -1042,7 +1042,7 @@
     if (s->input_buffer) {
         /* copy input buffer to decoder context to avoid reading past the end
            of the buffer, which can be caused by a damaged input stream. */
-        memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_MAX_FRAME_SIZE));
+        memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE));
         init_get_bits(&s->gbc, s->input_buffer, buf_size * 8);
     } else {
         init_get_bits(&s->gbc, buf, buf_size * 8);