mirror of https://git.ffmpeg.org/ffmpeg.git
wavpackenc: do not copy samples if they are not available
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
571efd9729
commit
02eb15a6c1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue