Mercurial > libavformat.hg
changeset 330:c393ab803bcd libavformat
copy packet without omitting the padding
author | bellard |
---|---|
date | Tue, 09 Dec 2003 15:34:44 +0000 |
parents | d20a3caaef29 |
children | 4530681af424 |
files | utils.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Tue Dec 09 00:17:43 2003 +0000 +++ b/utils.c Tue Dec 09 15:34:44 2003 +0000 @@ -167,12 +167,14 @@ { 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; }