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

Side by Side Diff: libavcodec/pthread.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 | « chromium/patches/to_upstream/55_h264_nal.patch ('k') | libavcodec/utils.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 * Copyright (c) 2004 Roman Shaposhnik 2 * Copyright (c) 2004 Roman Shaposhnik
3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) 3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com)
4 * 4 *
5 * Many thanks to Steven M. Schultz for providing clever ideas and 5 * Many thanks to Steven M. Schultz for providing clever ideas and
6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial 6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial
7 * implementation. 7 * implementation.
8 * 8 *
9 * This file is part of FFmpeg. 9 * This file is part of FFmpeg.
10 * 10 *
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 { 603 {
604 FrameThreadContext *fctx = avctx->thread_opaque; 604 FrameThreadContext *fctx = avctx->thread_opaque;
605 int finished = fctx->next_finished; 605 int finished = fctx->next_finished;
606 PerThreadContext *p; 606 PerThreadContext *p;
607 int err; 607 int err;
608 608
609 /* 609 /*
610 * Submit a packet to the next decoding thread. 610 * Submit a packet to the next decoding thread.
611 */ 611 */
612 612
613 if (fctx->next_decoding >= avctx->thread_count) return err;
613 p = &fctx->threads[fctx->next_decoding]; 614 p = &fctx->threads[fctx->next_decoding];
614 err = update_context_from_user(p->avctx, avctx); 615 err = update_context_from_user(p->avctx, avctx);
615 if (err) return err; 616 if (err) return err;
616 err = submit_packet(p, avpkt); 617 err = submit_packet(p, avpkt);
617 if (err) return err; 618 if (err) return err;
618 619
619 /* 620 /*
620 * If we're still receiving the initial packets, don't return a frame. 621 * If we're still receiving the initial packets, don't return a frame.
621 */ 622 */
622 623
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 return 0; 1063 return 0;
1063 } 1064 }
1064 1065
1065 void ff_thread_free(AVCodecContext *avctx) 1066 void ff_thread_free(AVCodecContext *avctx)
1066 { 1067 {
1067 if (avctx->active_thread_type&FF_THREAD_FRAME) 1068 if (avctx->active_thread_type&FF_THREAD_FRAME)
1068 frame_thread_free(avctx, avctx->thread_count); 1069 frame_thread_free(avctx, avctx->thread_count);
1069 else 1070 else
1070 thread_free(avctx); 1071 thread_free(avctx);
1071 } 1072 }
OLDNEW
« no previous file with comments | « chromium/patches/to_upstream/55_h264_nal.patch ('k') | libavcodec/utils.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698