mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
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>
This commit is contained in:
parent
96fc192733
commit
8ab706677c
@ -114,14 +114,14 @@ static int evc_frame_merge_filter(AVBSFContext *bsf, AVPacket *out)
|
||||
av_packet_unref(in);
|
||||
|
||||
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;
|
||||
|
||||
ctx->au_buffer.data_size = 0;
|
||||
if (!data)
|
||||
return AVERROR(ENOMEM);
|
||||
err = av_new_packet(out, data_size);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
err = av_packet_from_data(out, data, data_size);
|
||||
memcpy(out->data, ctx->au_buffer.data, data_size);
|
||||
} else
|
||||
err = AVERROR(EAGAIN);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user