Do not assume that if pkt->destruct != av_destruct_packet then it is not

necessary to call the destruct method

Originally committed as revision 16506 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Luca Abeni 16 years ago
parent 1d6eeebe08
commit 65007a4fa0
  1. 2
      libavformat/utils.c

@ -295,7 +295,7 @@ int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
int av_dup_packet(AVPacket *pkt) int av_dup_packet(AVPacket *pkt)
{ {
if (pkt->destruct != av_destruct_packet && pkt->data) { if (((pkt->destruct == av_destruct_packet_nofree) || (pkt->destruct == NULL)) && pkt->data) {
uint8_t *data; uint8_t *data;
/* We duplicate the packet and don't forget to add the padding again. */ /* We duplicate the packet and don't forget to add the padding again. */
if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE) if((unsigned)pkt->size > (unsigned)pkt->size + FF_INPUT_BUFFER_PADDING_SIZE)

Loading…
Cancel
Save