Browse Source

avcodec/utvideoenc: fix slice_bits size

Fixes assertion failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 11 years ago
parent
commit
0a8c90202b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/utvideoenc.c

+ 2
- 2
libavcodec/utvideoenc.c View File

@@ -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");


Loading…
Cancel
Save