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

Unified Diff: libavformat/oggdec.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: Make vp3 fix an ignore. 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
« no previous file with comments | « libavformat/oggdec.h ('k') | libavformat/oggparsetheora.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libavformat/oggdec.c
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 0e0b83804c19f87deb806151d98b99698aa7db93..81066ca673cec1946ce235c12c9b2641e9a21ecc 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -629,8 +629,15 @@ static int ogg_read_close(AVFormatContext *s)
int i;
for (i = 0; i < ogg->nstreams; i++){
- av_free (ogg->streams[i].buf);
- av_free (ogg->streams[i].private);
+ struct ogg_stream os = ogg->streams[i];
+ struct oggvorbis_private *priv = os.private;
+ if (priv && priv->packet && os.buf) {
+ int pkt_type = os.buf[os.pstart];
+ if (pkt_type & 1 && pkt_type <= 5)
+ av_freep (&priv->packet[pkt_type >> 1]);
+ }
+ av_free (os.buf);
+ av_free (os.private);
}
av_free (ogg->streams);
return 0;
« no previous file with comments | « libavformat/oggdec.h ('k') | libavformat/oggparsetheora.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698