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

Unified Diff: libavcodec/vp3.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libavcodec/vorbisdec.c ('k') | libavcodec/vp8.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libavcodec/vp3.c
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index b5daafcefb34d6050795643050735ef20560ca8e..3d79a7de9e4847508089211ed902b9ff27631c8d 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -399,7 +399,7 @@ static void init_loop_filter(Vp3DecodeContext *s)
/* set up the bounding values */
memset(s->bounding_values_array, 0, 256 * sizeof(int));
- for (x = 0; x < filter_limit; x++) {
+ for (x = 0; x < filter_limit && x < 128; x++) {
bounding_values[-x] = -x;
bounding_values[x] = x;
}
@@ -1630,7 +1630,7 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
s->superblock_coding = av_malloc(s->superblock_count);
s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment));
s->coded_fragment_list[0] = av_malloc(s->fragment_count * sizeof(int));
- s->dct_tokens_base = av_malloc(64*s->fragment_count * sizeof(*s->dct_tokens_base));
+ s->dct_tokens_base = av_mallocz(64*s->fragment_count * sizeof(*s->dct_tokens_base));
s->motion_val[0] = av_malloc(y_fragment_count * sizeof(*s->motion_val[0]));
s->motion_val[1] = av_malloc(c_fragment_count * sizeof(*s->motion_val[1]));
« no previous file with comments | « libavcodec/vorbisdec.c ('k') | libavcodec/vp8.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698