aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/flashsv2enc.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 00:47:05 +0100
commitc681f86a324d6181c31006edb300356af47e91cd (patch)
tree9a89be2db73422d2754b32f91bcbd98676beb2cf /libavcodec/flashsv2enc.c
parent1979bfecc78034426bf39442cfbd8a3c8c35e6ae (diff)
downloadffmpeg-c681f86a324d6181c31006edb300356af47e91cd.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 Conflicts: libavcodec/adpcmenc.c libavcodec/proresenc.c
Diffstat (limited to 'libavcodec/flashsv2enc.c')
-rw-r--r--libavcodec/flashsv2enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c
index 7ee299cf7c..86a35b6f34 100644
--- a/libavcodec/flashsv2enc.c
+++ b/libavcodec/flashsv2enc.c
@@ -270,7 +270,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
if (buf_size < 5)
return -1;
- init_put_bits(&pb, buf, buf_size * 8);
+ init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, (s->block_width >> 4) - 1);
put_bits(&pb, 12, s->image_width);