[FFmpeg-cvslog] libstagefright: avoid memory leak

Mohamed Naufal git at videolan.org
Thu Apr 19 02:17:06 CEST 2012


ffmpeg | branch: master | Mohamed Naufal <naufal22 at gmail.com> | Thu Apr 19 03:18:41 2012 +0530| [f51b7e52a6b31e98a82ce48dddac9cabc1e62e04] | committer: Mohamed Naufal

libstagefright: avoid memory leak

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

 libavcodec/libstagefright.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp
index ef45fae..a74c5a3 100644
--- a/libavcodec/libstagefright.cpp
+++ b/libavcodec/libstagefright.cpp
@@ -400,6 +400,8 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
                 frame->size = orig_size;
             }
             memcpy(frame->buffer, ptr, orig_size);
+            if (avpkt == &pkt)
+                av_free(avpkt->data);
 
             frame->time = ++s->frame_index;
             (*s->ts_map)[s->frame_index].pts = avpkt->pts;



More information about the ffmpeg-cvslog mailing list