avcodec/evc_frame_merge_bsf: use av_new_packet()

This ensures the buffer is padded as required by the AVPacket API.

Signed-off-by: James Almer <jamrial@gmail.com>
pull/389/head
James Almer 1 year ago
parent 96fc192733
commit 8ab706677c
  1. 8
      libavcodec/evc_frame_merge_bsf.c

@ -114,14 +114,14 @@ static int evc_frame_merge_filter(AVBSFContext *bsf, AVPacket *out)
av_packet_unref(in); av_packet_unref(in);
if (au_end_found) { if (au_end_found) {
uint8_t *data = av_memdup(ctx->au_buffer.data, ctx->au_buffer.data_size);
size_t data_size = ctx->au_buffer.data_size; size_t data_size = ctx->au_buffer.data_size;
ctx->au_buffer.data_size = 0; ctx->au_buffer.data_size = 0;
if (!data) err = av_new_packet(out, data_size);
return AVERROR(ENOMEM); if (err < 0)
return err;
err = av_packet_from_data(out, data, data_size); memcpy(out->data, ctx->au_buffer.data, data_size);
} else } else
err = AVERROR(EAGAIN); err = AVERROR(EAGAIN);

Loading…
Cancel
Save