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

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: 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
2707 MOVStreamContext *sc = st->priv_data;
2708 if (sc) {
2709 if (sc->keyframes)
2710 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.
2711 if (sc->stsc_data)
2712 av_freep(&sc->stsc_data);
2713 if (sc->sample_sizes)
2714 av_freep(&sc->sample_sizes);
2715 if (sc->chunk_offsets)
2716 av_freep(&sc->chunk_offsets);
2717 if (sc->stts_data)
2718 av_freep(&sc->stts_data);
2719 if (sc->drefs)
2720 av_freep(&sc->drefs);
2721 }
2722
2705 av_freep(&st->priv_data); 2723 av_freep(&st->priv_data);
2706 av_freep(&st->info); 2724 av_freep(&st->info);
2707 av_freep(&st); 2725 av_freep(&st);
2708 } 2726 }
2709 for(i=s->nb_programs-1; i>=0; i--) { 2727 for(i=s->nb_programs-1; i>=0; i--) {
2710 av_dict_free(&s->programs[i]->metadata); 2728 av_dict_free(&s->programs[i]->metadata);
2711 av_freep(&s->programs[i]->stream_index); 2729 av_freep(&s->programs[i]->stream_index);
2712 av_freep(&s->programs[i]); 2730 av_freep(&s->programs[i]);
2713 } 2731 }
2714 av_freep(&s->programs); 2732 av_freep(&s->programs);
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 } 4205 }
4188 4206
4189 const struct AVCodecTag *avformat_get_riff_video_tags(void) 4207 const struct AVCodecTag *avformat_get_riff_video_tags(void)
4190 { 4208 {
4191 return ff_codec_bmp_tags; 4209 return ff_codec_bmp_tags;
4192 } 4210 }
4193 const struct AVCodecTag *avformat_get_riff_audio_tags(void) 4211 const struct AVCodecTag *avformat_get_riff_audio_tags(void)
4194 { 4212 {
4195 return ff_codec_wav_tags; 4213 return ff_codec_wav_tags;
4196 } 4214 }
OLDNEW
« 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