aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-01 02:40:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-01 02:57:15 +0100
commit0a8c90202bb906747168a698b6837496f82c717c (patch)
treed2af50fdce483d5347a285bd506a5eb2c581380a /libavcodec
parent0c9dd939cdd16d3353382e06684b8d41fc4a3ce4 (diff)
downloadffmpeg-0a8c90202bb906747168a698b6837496f82c717c.tar.gz
avcodec/utvideoenc: fix slice_bits size
Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utvideoenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 74b28f9905..0db85a871f 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -494,7 +494,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
* get the offset in bits and convert to bytes.
*/
offset += write_huff_codes(dst + sstart * width, c->slice_bits,
- width * (send - sstart), width,
+ width * height + 4, width,
send - sstart, he) >> 3;
slice_len = offset - slice_len;
@@ -551,7 +551,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream2_init_writer(&pb, dst, pkt->size);
- av_fast_padded_malloc(&c->slice_bits, &c->slice_bits_size, width * height);
+ av_fast_padded_malloc(&c->slice_bits, &c->slice_bits_size, width * height + 4);
if (!c->slice_bits) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 2.\n");