aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorThilo Borgmann <thilo.borgmann@googlemail.com>2010-02-17 22:53:25 +0000
committerThilo Borgmann <thilo.borgmann@googlemail.com>2010-02-17 22:53:25 +0000
commitcd0928492410c5a93959d664362cd0d0ee50b961 (patch)
treea2314f382d0c8b80119f899ca9fa168084e8c3d3 /libavcodec
parent43cfefafbf9b06792c8f8f96afdcb541f551e300 (diff)
downloadffmpeg-cd0928492410c5a93959d664362cd0d0ee50b961.tar.gz
Fix wrong buffer allocation for MCC in ALS.
Originally committed as revision 21871 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/alsdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index b9a22850cb..25b61ec0ab 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1563,7 +1563,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
// allocate and assign channel data buffer for mcc mode
if (sconf->mc_coding) {
ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) *
- num_buffers);
+ num_buffers * num_buffers);
ctx->chan_data = av_malloc(sizeof(ALSChannelData) *
num_buffers);
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
@@ -1576,7 +1576,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
for (c = 0; c < num_buffers; c++)
- ctx->chan_data[c] = ctx->chan_data_buffer + c;
+ ctx->chan_data[c] = ctx->chan_data_buffer + c * num_buffers;
} else {
ctx->chan_data = NULL;
ctx->chan_data_buffer = NULL;