changeset 11198:00854e4457f2 libavcodec

Fix wrong buffer allocation for MCC in ALS.
author thilo.borgmann
date Wed, 17 Feb 2010 22:53:25 +0000
parents 87bcae769ee7
children f1b38a8588b2
files alsdec.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/alsdec.c	Wed Feb 17 21:20:43 2010 +0000
+++ b/alsdec.c	Wed Feb 17 22:53:25 2010 +0000
@@ -1563,7 +1563,7 @@
     // 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 @@
         }
 
         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;