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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « libavformat/oggdec.h ('k') | libavformat/oggparsetheora.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Ogg bitstream support 2 * Ogg bitstream support
3 * Luca Barbato <lu_zero@gentoo.org> 3 * Luca Barbato <lu_zero@gentoo.org>
4 * Based on tcvp implementation 4 * Based on tcvp implementation
5 */ 5 */
6 6
7 /* 7 /*
8 Copyright (C) 2005 Michael Ahlberg, Måns Rullgård 8 Copyright (C) 2005 Michael Ahlberg, Måns Rullgård
9 9
10 Permission is hereby granted, free of charge, to any person 10 Permission is hereby granted, free of charge, to any person
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 622
623 return psize; 623 return psize;
624 } 624 }
625 625
626 static int ogg_read_close(AVFormatContext *s) 626 static int ogg_read_close(AVFormatContext *s)
627 { 627 {
628 struct ogg *ogg = s->priv_data; 628 struct ogg *ogg = s->priv_data;
629 int i; 629 int i;
630 630
631 for (i = 0; i < ogg->nstreams; i++){ 631 for (i = 0; i < ogg->nstreams; i++){
632 av_free (ogg->streams[i].buf); 632 struct ogg_stream os = ogg->streams[i];
633 av_free (ogg->streams[i].private); 633 struct oggvorbis_private *priv = os.private;
634 if (priv && priv->packet && os.buf) {
635 int pkt_type = os.buf[os.pstart];
636 if (pkt_type & 1 && pkt_type <= 5)
637 av_freep (&priv->packet[pkt_type >> 1]);
638 }
639 av_free (os.buf);
640 av_free (os.private);
634 } 641 }
635 av_free (ogg->streams); 642 av_free (ogg->streams);
636 return 0; 643 return 0;
637 } 644 }
638 645
639 static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index, 646 static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
640 int64_t *pos_arg, int64_t pos_limit) 647 int64_t *pos_arg, int64_t pos_limit)
641 { 648 {
642 struct ogg *ogg = s->priv_data; 649 struct ogg *ogg = s->priv_data;
643 AVIOContext *bc = s->pb; 650 AVIOContext *bc = s->pb;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 .priv_data_size = sizeof(struct ogg), 743 .priv_data_size = sizeof(struct ogg),
737 .read_probe = ogg_probe, 744 .read_probe = ogg_probe,
738 .read_header = ogg_read_header, 745 .read_header = ogg_read_header,
739 .read_packet = ogg_read_packet, 746 .read_packet = ogg_read_packet,
740 .read_close = ogg_read_close, 747 .read_close = ogg_read_close,
741 .read_seek = ogg_read_seek, 748 .read_seek = ogg_read_seek,
742 .read_timestamp = ogg_read_timestamp, 749 .read_timestamp = ogg_read_timestamp,
743 .extensions = "ogg", 750 .extensions = "ogg",
744 .flags = AVFMT_GENERIC_INDEX, 751 .flags = AVFMT_GENERIC_INDEX,
745 }; 752 };
OLDNEW
« 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