changeset 4183:046a97603352 libavformat

Do not assume that if pkt->destruct != av_destruct_packet then it is not necessary to call the destruct method
author lucabe
date Fri, 09 Jan 2009 20:10:13 +0000
parents 313d987dd2b4
children bc40129f13cc
files utils.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Fri Jan 09 01:30:14 2009 +0000
+++ b/utils.c	Fri Jan 09 20:10:13 2009 +0000
@@ -295,7 +295,7 @@
 
 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;
         /* 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)