diff options
author | Martin Storsjö <martin@martin.st> | 2014-06-05 11:48:53 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-06-26 12:58:46 +0200 |
commit | 771564945aa9aebe2f30192b925fcf4909225eca (patch) | |
tree | 9fa26b30b4ef88aac973777909b8df2643c7ff8f /libavcodec/adpcmenc.c | |
parent | 16f7cbef5610a878317596134607d2a89da66ecf (diff) | |
download | ffmpeg-771564945aa9aebe2f30192b925fcf4909225eca.tar.gz |
adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3d79d0c93e5b37a35b1b22d6c18699c233aad1ba)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r-- | libavcodec/adpcmenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index fb3ce0d24b..2cf8d6f8a2 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -549,7 +549,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, put_bits(&pb, 7, status->step_index); if (avctx->trellis > 0) { uint8_t buf[64]; - adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status, + adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status, 64, 1); for (i = 0; i < 64; i++) put_bits(&pb, 4, buf[i ^ 1]); |