Revision 6e075dca libavcodec/ac3dec.c

View differences:

libavcodec/ac3dec.c
37 37
#include "ac3dec_data.h"
38 38
#include "kbdwin.h"
39 39

  
40
/** Large enough for maximum possible frame size when the specification limit is ignored */
41
#define AC3_FRAME_BUFFER_SIZE 32768
42

  
43 40
/**
44 41
 * table for ungrouping 3 values in 7 bits.
45 42
 * used for exponents and bap=2 mantissas
......
204 201
    }
205 202
    s->downmixed = 1;
206 203

  
207
    /* allocate context input buffer */
208
        s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
209
        if (!s->input_buffer)
210
            return AVERROR(ENOMEM);
211

  
212 204
    /* ffdshow custom code */
213 205
#if CONFIG_AUDIO_FLOAT
214 206
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
......
1441 1433
    ff_mdct_end(&s->imdct_512);
1442 1434
    ff_mdct_end(&s->imdct_256);
1443 1435

  
1444
    av_freep(&s->input_buffer);
1445

  
1446 1436
    return 0;
1447 1437
}
1448 1438

  

Also available in: Unified diff