Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
- index f650c4f..c87bddb 100644
- --- a/libavcodec/utvideoenc.c
- +++ b/libavcodec/utvideoenc.c
- @@ -623,19 +623,18 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
- int i, ret = 0;
- /* Allocate a new packet if needed, and set it to the pointer dst */
- - if (!pkt->data)
- - ret = av_new_packet(pkt, (256 + 4 * c->slices +
- - width * height) * c->planes + 4);
- + ret = ff_alloc_packet(pkt, (256 + 4 * c->slices + width * height) *
- + c->planes + 4);
- - if (ret) {
- - av_log(avctx, AV_LOG_ERROR, "Error allocating output packet.\n");
- + if (ret < 0) {
- + av_log(avctx, AV_LOG_ERROR,
- + "Error allocating the output packet, or the provided packet was too small.\n");
- return ret;
- }
- dst = pkt->data;
- - bytestream2_init_writer(&pb, dst, (256 + 4 * c->slices +
- - width * height) * c->planes + 4);
- + bytestream2_init_writer(&pb, dst, pkt->size);
- av_fast_malloc(&c->slice_bits, &c->slice_bits_size,
- width * height + FF_INPUT_BUFFER_PADDING_SIZE);
Add Comment
Please, Sign In to add comment