[vlc-commits] avcodec: Fix memory leak in EncodeVideo

Brian Schmidt git at videolan.org
Mon Apr 7 19:53:42 CEST 2014


vlc | branch: master | Brian Schmidt <brian.schmidt at weather.com> | Mon Apr  7 11:01:13 2014 -0400| [bce0b5cfc6574a64b6e1cfd089a1b1225a1b1fa2] | committer: Tristan Matthews

avcodec: Fix memory leak in EncodeVideo

Signed-off-by: Tristan Matthews <le.businessman at gmail.com>

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

 modules/codec/avcodec/encoder.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 9bfe238..d6f3a80 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1090,6 +1090,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
             {
                 msg_Warn( p_enc, "almost fed libavcodec with two frames with "
                           "the same PTS (%"PRId64 ")", frame->pts );
+                block_Release( p_block );
                 return NULL;
             }
             else if ( p_sys->i_last_pts > frame->pts )
@@ -1097,6 +1098,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
                 msg_Warn( p_enc, "almost fed libavcodec with a frame in the "
                          "past (current: %"PRId64 ", last: %"PRId64")",
                          frame->pts, p_sys->i_last_pts );
+                block_Release( p_block );
                 return NULL;
             }
             else



More information about the vlc-commits mailing list