diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-12-09 15:34:44 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-12-09 15:34:44 +0000 |
commit | 8a56ac7b8903370ea56477bb4076eabc7f0d2ac1 (patch) | |
tree | b1390d839d2fff7caf4184669ddd0d85ab590b51 /libavformat/utils.c | |
parent | 248a189a7d4dbb25a69a2516674986386b0b2b54 (diff) | |
download | ffmpeg-8a56ac7b8903370ea56477bb4076eabc7f0d2ac1.tar.gz |
copy packet without omitting the padding
Originally committed as revision 2584 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 7cbb1a0246..7100798266 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; } |