[vlc-devel] commit: Fixed potential memleaks in avformat wrapper. (Laurent Aimar )

git version control git at videolan.org
Wed Feb 24 00:14:15 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Feb 23 22:51:08 2010 +0100| [bee1e640081f8013f058fd147d6d4d80d20f47b0] | committer: Laurent Aimar 

Fixed potential memleaks in avformat wrapper.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bee1e640081f8013f058fd147d6d4d80d20f47b0
---

 modules/demux/avformat/demux.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 9472b5d..ffde832 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -508,12 +508,18 @@ static int Demux( demux_t *p_demux )
     {
         p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );
         if( !p_frame )
+        {
+            av_free_packet( &pkt );
             return 1;
+        }
     }
     else
     {
         if( ( p_frame = block_New( p_demux, pkt.size ) ) == NULL )
+        {
+            av_free_packet( &pkt );
             return 0;
+        }
         memcpy( p_frame->p_buffer, pkt.data, pkt.size );
     }
 




More information about the vlc-devel mailing list