Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-01 05:40:19 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-03-08 19:25:20 +0400
commite59fe789581324ac48b669caed0ac61fa05902a2 (patch)
tree796ba908015fdf2fe5cba43b9a987b441c58e7d7
parenta0d15a6271a7af4113af4c9921e4f17e6271eee5 (diff)
avcodec/utvideoenc: fix slice_bits size
Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 0a8c90202bb906747168a698b6837496f82c717c) Conflicts: libavcodec/utvideoenc.c (cherry picked from commit 57522ca79cc38c279123596d3288ddbf56fa8903) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utvideoenc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index fe5636fd0b..9e1edd3376 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -468,7 +468,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;
@@ -525,8 +525,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream2_init_writer(&pb, dst, pkt->size);
- av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
- width * height + FF_INPUT_BUFFER_PADDING_SIZE);
+ 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");