aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-08-17 22:25:49 +0000
committerPaul B Mahol <onemda@gmail.com>2013-08-17 22:25:49 +0000
commit02eb15a6c1b421c4b15f80630faf3f53957a5909 (patch)
tree1b4c16138027537708c86a332d20e3c88ee97e05
parent571efd972986c857c50f2ddc6e3cfb320f06450f (diff)
downloadffmpeg-02eb15a6c1b421c4b15f80630faf3f53957a5909.tar.gz
wavpackenc: do not copy samples if they are not available
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavcodec/wavpackenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 3cc74bd88d..10e6e141aa 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -2531,9 +2531,11 @@ static int wavpack_encode_block(WavPackEncodeContext *s,
if ((s->flags & WV_FLOAT_DATA) || (s->flags & MAG_MASK) >> MAG_LSB >= 24) {
av_fast_padded_malloc(&s->orig_l, &s->orig_l_size, sizeof(int32_t) * nb_samples);
- av_fast_padded_malloc(&s->orig_r, &s->orig_r_size, sizeof(int32_t) * nb_samples);
memcpy(s->orig_l, samples_l, sizeof(int32_t) * nb_samples);
- memcpy(s->orig_r, samples_r, sizeof(int32_t) * nb_samples);
+ if (!(s->flags & WV_MONO_DATA)) {
+ av_fast_padded_malloc(&s->orig_r, &s->orig_r_size, sizeof(int32_t) * nb_samples);
+ memcpy(s->orig_r, samples_r, sizeof(int32_t) * nb_samples);
+ }
if (s->flags & WV_FLOAT_DATA)
got_extra = scan_float(s, samples_l, samples_r, nb_samples);