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

Side by Side Diff: libavformat/oggparsetheora.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 | « libavformat/oggdec.c ('k') | libavformat/oggparsevorbis.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) 2005 Matthieu CASTET, Alex Beregszaszi 2 Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi
3 3
4 Permission is hereby granted, free of charge, to any person 4 Permission is hereby granted, free of charge, to any person
5 obtaining a copy of this software and associated documentation 5 obtaining a copy of this software and associated documentation
6 files (the "Software"), to deal in the Software without 6 files (the "Software"), to deal in the Software without
7 restriction, including without limitation the rights to use, copy, 7 restriction, including without limitation the rights to use, copy,
8 modify, merge, publish, distribute, sublicense, and/or sell copies 8 modify, merge, publish, distribute, sublicense, and/or sell copies
9 of the Software, and to permit persons to whom the Software is 9 of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions: 10 furnished to do so, subject to the following conditions:
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 return 1; 124 return 1;
125 } 125 }
126 126
127 static uint64_t 127 static uint64_t
128 theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp, int64_t *dts) 128 theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp, int64_t *dts)
129 { 129 {
130 struct ogg *ogg = ctx->priv_data; 130 struct ogg *ogg = ctx->priv_data;
131 struct ogg_stream *os = ogg->streams + idx; 131 struct ogg_stream *os = ogg->streams + idx;
132 struct theora_params *thp = os->private; 132 struct theora_params *thp = os->private;
133 if (!thp) return NULL;
133 uint64_t iframe = gp >> thp->gpshift; 134 uint64_t iframe = gp >> thp->gpshift;
134 uint64_t pframe = gp & thp->gpmask; 135 uint64_t pframe = gp & thp->gpmask;
135 136
136 if (thp->version < 0x030201) 137 if (thp->version < 0x030201)
137 iframe++; 138 iframe++;
138 139
139 if(!pframe) 140 if(!pframe)
140 os->pflags |= AV_PKT_FLAG_KEY; 141 os->pflags |= AV_PKT_FLAG_KEY;
141 142
142 if (dts) 143 if (dts)
143 *dts = iframe + pframe; 144 *dts = iframe + pframe;
144 145
145 return iframe + pframe; 146 return iframe + pframe;
146 } 147 }
147 148
148 const struct ogg_codec ff_theora_codec = { 149 const struct ogg_codec ff_theora_codec = {
149 .magic = "\200theora", 150 .magic = "\200theora",
150 .magicsize = 7, 151 .magicsize = 7,
151 .header = theora_header, 152 .header = theora_header,
152 .gptopts = theora_gptopts 153 .gptopts = theora_gptopts
153 }; 154 };
OLDNEW
« no previous file with comments | « libavformat/oggdec.c ('k') | libavformat/oggparsevorbis.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698