[FFmpeg-cvslog] avcodec/utvideoenc: fix slice_bits size
Michael Niedermayer
git at videolan.org
Fri Mar 7 04:08:49 CET 2014
ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 1 02:40:19 2014 +0100| [d891fc9181dd8ea7485ddaac68db888c5c5dd28c] | committer: Michael Niedermayer
avcodec/utvideoenc: fix slice_bits size
Fixes assertion failure
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 0a8c90202bb906747168a698b6837496f82c717c)
Conflicts:
libavcodec/utvideoenc.c
(cherry picked from commit 57522ca79cc38c279123596d3288ddbf56fa8903)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d891fc9181dd8ea7485ddaac68db888c5c5dd28c
---
libavcodec/utvideoenc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 7167278..17c4245 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");
More information about the ffmpeg-cvslog
mailing list