Browse Source

avcodec/opusdec: Fix extra samples read index

Fixes crash
Fixes Ticket4969 part 1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Michael Niedermayer 10 years ago
parent
commit
07225fa74f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/opusdec.c

+ 2
- 2
libavcodec/opusdec.c View File

@@ -565,8 +565,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
if (buffer_samples) {
float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0],
c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] };
buf[0] += buffer_samples;
buf[1] += buffer_samples;
buf[0] += decoded_samples;
buf[1] += decoded_samples;
ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples);
if (ret < 0)
return ret;


Loading…
Cancel
Save