Commit 0d0fa117 authored by bellard's avatar bellard

copy packet without omitting the padding


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2584 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e0b1534e
......@@ -167,12 +167,14 @@ int av_dup_packet(AVPacket *pkt)
{
if (pkt->destruct != av_destruct_packet) {
uint8_t *data;
/* we duplicate the packet */
data = av_malloc(pkt->size);
/* we duplicate the packet and don't forget to put the padding
again */
data = av_malloc(pkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!data) {
return AVERROR_NOMEM;
}
memcpy(data, pkt->data, pkt->size);
memset(data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
pkt->data = data;
pkt->destruct = av_destruct_packet;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment