Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: libavformat/utils.c

Issue 9373002: Fix valgrind and asan memory leaks and crashes. (Closed) Base URL: ssh://gerrit.chromium.org:29418/chromium/third_party/ffmpeg.git@master
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« libavcodec/vp3.c ('K') | « libavcodec/vp3.c ('k') | valgrind.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libavformat/utils.c
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d974ccd0cde8979c3311f20459d7791bb69edc6c..cb763043a51cc64c3fca1c9579ad298d51f3f1c3 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -33,6 +33,7 @@
#include "libavutil/pixdesc.h"
#include "metadata.h"
#include "id3v2.h"
+#include "isom.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/mathematics.h"
@@ -2702,6 +2703,23 @@ void avformat_free_context(AVFormatContext *s)
av_freep(&st->codec->extradata);
av_freep(&st->codec->subtitle_header);
av_freep(&st->codec);
+
+ MOVStreamContext *sc = st->priv_data;
+ if (sc) {
+ if (sc->keyframes)
+ av_freep(&sc->keyframes);
rbultje1 2012/02/08 23:51:56 av_freep() does the if() internally, so no need fo
DaleCurtis 2012/02/09 04:03:28 Done.
+ if (sc->stsc_data)
+ av_freep(&sc->stsc_data);
+ if (sc->sample_sizes)
+ av_freep(&sc->sample_sizes);
+ if (sc->chunk_offsets)
+ av_freep(&sc->chunk_offsets);
+ if (sc->stts_data)
+ av_freep(&sc->stts_data);
+ if (sc->drefs)
+ av_freep(&sc->drefs);
+ }
+
av_freep(&st->priv_data);
av_freep(&st->info);
av_freep(&st);
« libavcodec/vp3.c ('K') | « libavcodec/vp3.c ('k') | valgrind.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698