summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-11-03 20:54:38 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-11 14:18:22 -0500
commit5c210e2cb9d7fbdd6175e116502c8ce23267843c (patch)
treed3c8eeeab10c3f288fc032daee58162a9332a7d7 /libavcodec/shorten.c
parentbefc473c0075ba5afbd38b8fb0c33cd07deec51d (diff)
shorten: do not modify samples pointer when interleaving
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index f510bcc380..da36bd58eb 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -252,12 +252,13 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
return 0;
}
-static int16_t * interleave_buffer(int16_t *samples, int nchan, int blocksize, int32_t **buffer) {
+static void interleave_buffer(int16_t *samples, int nchan, int blocksize,
+ int32_t **buffer)
+{
int i, chan;
for (i=0; i<blocksize; i++)
for (chan=0; chan < nchan; chan++)
*samples++ = av_clip_int16(buffer[chan][i]);
- return samples;
}
static const int fixed_coeffs[3][3] = {
@@ -576,7 +577,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n");
return AVERROR(EINVAL);
}
- samples = interleave_buffer(samples, s->channels, s->blocksize, s->decoded);
+ interleave_buffer(samples, s->channels, s->blocksize, s->decoded);
*data_size = out_size;
}
}