[FFmpeg-cvslog] avcodec/opusdec: Fix extra samples read index

Michael Niedermayer git at videolan.org
Thu Nov 26 01:54:08 CET 2015


ffmpeg | branch: release/2.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue Oct 27 01:18:22 2015 +0100| [5ed5acb91070272dc4a5e2ae16eccb2f71311913] | committer: Andreas Cadhalpun

avcodec/opusdec: Fix extra samples read index

Fixes crash
Fixes Ticket4969 part 1

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 07225fa74f2cdb29d6d85fd33675539bfdfe9ea5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ed5acb91070272dc4a5e2ae16eccb2f71311913
---

 libavcodec/opusdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 9ef26c4..7acc7cf 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -569,8 +569,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;



More information about the ffmpeg-cvslog mailing list