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

Side by Side Diff: libavcodec/vp8.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/vp3.c ('k') | libavformat/mov.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 * VP8 compatible video decoder 2 * VP8 compatible video decoder
3 * 3 *
4 * Copyright (C) 2010 David Conrad 4 * Copyright (C) 2010 David Conrad
5 * Copyright (C) 2010 Ronald S. Bultje 5 * Copyright (C) 2010 Ronald S. Bultje
6 * Copyright (C) 2010 Jason Garrett-Glaser 6 * Copyright (C) 2010 Jason Garrett-Glaser
7 * 7 *
8 * This file is part of FFmpeg. 8 * This file is part of FFmpeg.
9 * 9 *
10 * FFmpeg is free software; you can redistribute it and/or 10 * FFmpeg is free software; you can redistribute it and/or
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 avcodec_set_dimensions(s->avctx, width, height); 118 avcodec_set_dimensions(s->avctx, width, height);
119 } 119 }
120 120
121 s->mb_width = (s->avctx->coded_width +15) / 16; 121 s->mb_width = (s->avctx->coded_width +15) / 16;
122 s->mb_height = (s->avctx->coded_height+15) / 16; 122 s->mb_height = (s->avctx->coded_height+15) / 16;
123 123
124 s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeo f(*s->macroblocks)); 124 s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeo f(*s->macroblocks));
125 s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_streng th)); 125 s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_streng th));
126 s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4); 126 s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4);
127 s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz)); 127 s->top_nnz = av_mallocz((s->mb_width+1)*sizeof(*s->top_nnz)) ;
128 s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_borde r)); 128 s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_borde r));
129 129
130 if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_to p || 130 if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_to p ||
131 !s->top_nnz || !s->top_border) 131 !s->top_nnz || !s->top_border)
132 return AVERROR(ENOMEM); 132 return AVERROR(ENOMEM);
133 133
134 s->macroblocks = s->macroblocks_base + 1; 134 s->macroblocks = s->macroblocks_base + 1;
135 135
136 return 0; 136 return 0;
137 } 137 }
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 .priv_data_size = sizeof(VP8Context), 1845 .priv_data_size = sizeof(VP8Context),
1846 .init = vp8_decode_init, 1846 .init = vp8_decode_init,
1847 .close = vp8_decode_free, 1847 .close = vp8_decode_free,
1848 .decode = vp8_decode_frame, 1848 .decode = vp8_decode_frame,
1849 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS, 1849 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
1850 .flush = vp8_decode_flush, 1850 .flush = vp8_decode_flush,
1851 .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), 1851 .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
1852 .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy ), 1852 .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy ),
1853 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_co ntext), 1853 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_co ntext),
1854 }; 1854 };
OLDNEW
« no previous file with comments | « libavcodec/vp3.c ('k') | libavformat/mov.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698