aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adpcmenc.c
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2015-02-26 10:17:01 -0800
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 18:03:50 +0100
commitc89645c3ef4b975aac0b25a5a8c1707a2567d7da (patch)
treec39909696b7c06ee058c7d0ef8232abbf009b9cc /libavcodec/adpcmenc.c
parent0c1f8a784db9d60f30f838153f03e325437ec844 (diff)
downloadffmpeg-c89645c3ef4b975aac0b25a5a8c1707a2567d7da.tar.gz
Fix buffer_size argument to init_put_bits() in multiple encoders.
Several encoders were multiplying the buffer size by 8, in order to get a bit size. However, the buffer_size argument is for the byte size of the buffer. We had experienced crashes encoding prores (Anatoliy) at size 4096x4096. (cherry picked from commit 50833c9f7b4e1922197a8955669f8ab3589c8cef) Conflicts: libavcodec/proresenc_kostya.c Conflicts: libavcodec/faxcompr.c libavcodec/s302menc.c Conflicts: libavcodec/adpcmenc.c
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r--libavcodec/adpcmenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 1b3d1bcd01..73da9272ec 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -551,7 +551,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
{
int ch, i;
PutBitContext pb;
- init_put_bits(&pb, dst, buf_size * 8);
+ init_put_bits(&pb, dst, buf_size);
for (ch = 0; ch < avctx->channels; ch++) {
put_bits(&pb, 9, (c->status[ch].prev_sample & 0xFFFF) >> 7);
@@ -582,7 +582,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
{
int i;
PutBitContext pb;
- init_put_bits(&pb, dst, buf_size * 8);
+ init_put_bits(&pb, dst, buf_size);
n = avctx->frame_size - 1;