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

Side by Side Diff: libavcodec/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: 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 | « libavcodec/pthread.c ('k') | libavcodec/vorbisdec.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 * utils for libavcodec 2 * utils for libavcodec
3 * Copyright (c) 2001 Fabrice Bellard 3 * Copyright (c) 2001 Fabrice Bellard
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> 4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
5 * 5 *
6 * This file is part of FFmpeg. 6 * This file is part of FFmpeg.
7 * 7 *
8 * FFmpeg is free software; you can redistribute it and/or 8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 867 }
868 868
869 avctx->pts_correction_num_faulty_pts = 869 avctx->pts_correction_num_faulty_pts =
870 avctx->pts_correction_num_faulty_dts = 0; 870 avctx->pts_correction_num_faulty_dts = 0;
871 avctx->pts_correction_last_pts = 871 avctx->pts_correction_last_pts =
872 avctx->pts_correction_last_dts = INT64_MIN; 872 avctx->pts_correction_last_dts = INT64_MIN;
873 873
874 if(avctx->codec->init && !(avctx->active_thread_type&FF_THREAD_FRAME)){ 874 if(avctx->codec->init && !(avctx->active_thread_type&FF_THREAD_FRAME)){
875 ret = avctx->codec->init(avctx); 875 ret = avctx->codec->init(avctx);
876 if (ret < 0) { 876 if (ret < 0) {
877 if(avctx->codec->close)
878 avctx->codec->close(avctx);
877 goto free_and_end; 879 goto free_and_end;
878 } 880 }
879 } 881 }
880 882
881 ret=0; 883 ret=0;
882 end: 884 end:
883 entangled_thread_counter--; 885 entangled_thread_counter--;
884 886
885 /* Release any user-supplied mutex. */ 887 /* Release any user-supplied mutex. */
886 if (ff_lockmgr_cb) { 888 if (ff_lockmgr_cb) {
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 else if (codec_id < CODEC_ID_FIRST_UNKNOWN) 2059 else if (codec_id < CODEC_ID_FIRST_UNKNOWN)
2058 return AVMEDIA_TYPE_SUBTITLE; 2060 return AVMEDIA_TYPE_SUBTITLE;
2059 2061
2060 return AVMEDIA_TYPE_UNKNOWN; 2062 return AVMEDIA_TYPE_UNKNOWN;
2061 } 2063 }
2062 2064
2063 int avcodec_is_open(AVCodecContext *s) 2065 int avcodec_is_open(AVCodecContext *s)
2064 { 2066 {
2065 return !!s->internal; 2067 return !!s->internal;
2066 } 2068 }
OLDNEW
« no previous file with comments | « libavcodec/pthread.c ('k') | libavcodec/vorbisdec.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698