[FFmpeg-cvslog] avcodec/avpacket: Use av_free_packet() in error cleanups

Michael Niedermayer git at videolan.org
Fri Aug 30 21:45:29 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Aug 30 20:57:55 2013 +0200| [6e1b1a27a4034c578018d5042b3c8228278c4cd6] | committer: Michael Niedermayer

avcodec/avpacket: Use av_free_packet() in error cleanups

This prevents memleaks on errors
reproduceable with fate when error pathes are forced

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e1b1a27a4034c578018d5042b3c8228278c4cd6
---

 libavcodec/avpacket.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 7196c31..b6b4109 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -215,7 +215,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     return 0;
 
 failed_alloc:
-    av_destruct_packet(pkt);
+    av_free_packet(pkt);
     return AVERROR(ENOMEM);
 }
 
@@ -237,7 +237,7 @@ int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src)
     return 0;
 
 failed_alloc:
-    av_destruct_packet(pkt);
+    av_free_packet(pkt);
     return AVERROR(ENOMEM);
 }
 



More information about the ffmpeg-cvslog mailing list