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

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: Notes. 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
Index: libavformat/utils.c
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d974ccd0cde8979c3311f20459d7791bb69edc6c..848dbac1b237a4dc91de1f6d91770c0b0b8e19ac 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,17 @@ void avformat_free_context(AVFormatContext *s)
av_freep(&st->codec->extradata);
av_freep(&st->codec->subtitle_header);
av_freep(&st->codec);
+ if (st->priv_data) {
+ MOVStreamContext *sc = st->priv_data;
rbultje1 2012/02/09 23:27:58 I'm actually wondering if we shouldn't check someh
DaleCurtis 2012/02/10 00:04:01 I'll take another look and see if there's somewher
DaleCurtis 2012/02/10 23:04:35 Done. Moved into read_close() in mov.c and added a
+ av_freep(&sc->chunk_offsets);
+ av_freep(&sc->ctts_data);
+ av_freep(&sc->drefs);
+ av_freep(&sc->keyframes);
+ av_freep(&sc->sample_sizes);
+ av_freep(&sc->stps_data);
+ av_freep(&sc->stsc_data);
+ av_freep(&sc->stts_data);
+ }
av_freep(&st->priv_data);
av_freep(&st->info);
av_freep(&st);

Powered by Google App Engine
This is Rietveld 408576698