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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * various utility functions for use within FFmpeg 2 * various utility functions for use within FFmpeg
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard 3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 * 4 *
5 * This file is part of FFmpeg. 5 * This file is part of FFmpeg.
6 * 6 *
7 * FFmpeg is free software; you can redistribute it and/or 7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version. 10 * version 2.1 of the License, or (at your option) any later version.
(...skipping 15 matching lines...) Expand all
26 #include "internal.h" 26 #include "internal.h"
27 #include "libavcodec/internal.h" 27 #include "libavcodec/internal.h"
28 #include "libavcodec/raw.h" 28 #include "libavcodec/raw.h"
29 #include "libavcodec/bytestream.h" 29 #include "libavcodec/bytestream.h"
30 #include "libavutil/avassert.h" 30 #include "libavutil/avassert.h"
31 #include "libavutil/opt.h" 31 #include "libavutil/opt.h"
32 #include "libavutil/dict.h" 32 #include "libavutil/dict.h"
33 #include "libavutil/pixdesc.h" 33 #include "libavutil/pixdesc.h"
34 #include "metadata.h" 34 #include "metadata.h"
35 #include "id3v2.h" 35 #include "id3v2.h"
36 #include "isom.h"
36 #include "libavutil/avassert.h" 37 #include "libavutil/avassert.h"
37 #include "libavutil/avstring.h" 38 #include "libavutil/avstring.h"
38 #include "libavutil/mathematics.h" 39 #include "libavutil/mathematics.h"
39 #include "libavutil/parseutils.h" 40 #include "libavutil/parseutils.h"
40 #include "riff.h" 41 #include "riff.h"
41 #include "audiointerleave.h" 42 #include "audiointerleave.h"
42 #include "url.h" 43 #include "url.h"
43 #include <sys/time.h> 44 #include <sys/time.h>
44 #include <time.h> 45 #include <time.h>
45 #include <stdarg.h> 46 #include <stdarg.h>
(...skipping 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 st = s->streams[i]; 2696 st = s->streams[i];
2696 if (st->parser) { 2697 if (st->parser) {
2697 av_parser_close(st->parser); 2698 av_parser_close(st->parser);
2698 av_free_packet(&st->cur_pkt); 2699 av_free_packet(&st->cur_pkt);
2699 } 2700 }
2700 av_dict_free(&st->metadata); 2701 av_dict_free(&st->metadata);
2701 av_freep(&st->index_entries); 2702 av_freep(&st->index_entries);
2702 av_freep(&st->codec->extradata); 2703 av_freep(&st->codec->extradata);
2703 av_freep(&st->codec->subtitle_header); 2704 av_freep(&st->codec->subtitle_header);
2704 av_freep(&st->codec); 2705 av_freep(&st->codec);
2706 if (st->priv_data) {
2707 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
2708 av_freep(&sc->chunk_offsets);
2709 av_freep(&sc->ctts_data);
2710 av_freep(&sc->drefs);
2711 av_freep(&sc->keyframes);
2712 av_freep(&sc->sample_sizes);
2713 av_freep(&sc->stps_data);
2714 av_freep(&sc->stsc_data);
2715 av_freep(&sc->stts_data);
2716 }
2705 av_freep(&st->priv_data); 2717 av_freep(&st->priv_data);
2706 av_freep(&st->info); 2718 av_freep(&st->info);
2707 av_freep(&st); 2719 av_freep(&st);
2708 } 2720 }
2709 for(i=s->nb_programs-1; i>=0; i--) { 2721 for(i=s->nb_programs-1; i>=0; i--) {
2710 av_dict_free(&s->programs[i]->metadata); 2722 av_dict_free(&s->programs[i]->metadata);
2711 av_freep(&s->programs[i]->stream_index); 2723 av_freep(&s->programs[i]->stream_index);
2712 av_freep(&s->programs[i]); 2724 av_freep(&s->programs[i]);
2713 } 2725 }
2714 av_freep(&s->programs); 2726 av_freep(&s->programs);
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 } 4199 }
4188 4200
4189 const struct AVCodecTag *avformat_get_riff_video_tags(void) 4201 const struct AVCodecTag *avformat_get_riff_video_tags(void)
4190 { 4202 {
4191 return ff_codec_bmp_tags; 4203 return ff_codec_bmp_tags;
4192 } 4204 }
4193 const struct AVCodecTag *avformat_get_riff_audio_tags(void) 4205 const struct AVCodecTag *avformat_get_riff_audio_tags(void)
4194 { 4206 {
4195 return ff_codec_wav_tags; 4207 return ff_codec_wav_tags;
4196 } 4208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698