Mercurial > libavformat.hg
diff utils.c @ 330:c393ab803bcd libavformat
copy packet without omitting the padding
| author | bellard |
|---|---|
| date | Tue, 09 Dec 2003 15:34:44 +0000 |
| parents | 6285d395baf4 |
| children | e3beadc2ed83 |
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; }
