From 7f215e3e725ddd45e6fc1e012aadcc5fd83ee1b5 Mon Sep 17 00:00:00 2001 From: Benjamin Larsson Date: Thu, 16 Feb 2012 20:09:01 +0600 Subject: [PATCH 1/2] Use fixed-length array in revert_mclms() --- libavcodec/wmalosslessdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 9b54abf465..30c055bcc4 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -885,7 +885,7 @@ static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred) static void revert_mclms(WmallDecodeCtx *s, int tile_size) { - int icoef, pred[s->num_channels]; + int icoef, pred[WMALL_MAX_CHANNELS] = {0}; for (icoef = 0; icoef < tile_size; icoef++) { mclms_predict(s, icoef, pred); mclms_update(s, icoef, pred); From a520a9946f25fe36000558cf8bb512109ea40353 Mon Sep 17 00:00:00 2001 From: Mashiat Sarker Shakkhar Date: Sat, 18 Feb 2012 21:00:03 +0600 Subject: [PATCH 2/2] Perform inter-channel decorr. only if both channels are coded --- libavcodec/wmalosslessdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 30c055bcc4..899645afa1 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1025,7 +1025,7 @@ static void revert_inter_ch_decorr(WmallDecodeCtx *s, int tile_size) int icoef; if (s->num_channels != 2) return; - else { + else if (s->is_channel_coded[0] && s->is_channel_coded[1]) { for (icoef = 0; icoef < tile_size; icoef++) { s->channel_residues[0][icoef] -= s->channel_residues[1][icoef] >> 1; s->channel_residues[1][icoef] += s->channel_residues[0][icoef];