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

Side by Side Diff: libavformat/oggparsevorbis.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/oggparsetheora.c ('k') | libavformat/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) 2005 Michael Ahlberg, Måns Rullgård 2 Copyright (C) 2005 Michael Ahlberg, Måns Rullgård
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 * [audio_channels] = read 8 bit integer as unsigned | Used 152 * [audio_channels] = read 8 bit integer as unsigned | Used
153 * [audio_sample_rate] = read 32 bits as unsigned integer | Used 153 * [audio_sample_rate] = read 32 bits as unsigned integer | Used
154 * [bitrate_maximum] = read 32 bits as signed integer | Not used yet 154 * [bitrate_maximum] = read 32 bits as signed integer | Not used yet
155 * [bitrate_nominal] = read 32 bits as signed integer | Not used yet 155 * [bitrate_nominal] = read 32 bits as signed integer | Not used yet
156 * [bitrate_minimum] = read 32 bits as signed integer | Used as bitrate 156 * [bitrate_minimum] = read 32 bits as signed integer | Used as bitrate
157 * [blocksize_0] = read 4 bits as unsigned integer | Not Used 157 * [blocksize_0] = read 4 bits as unsigned integer | Not Used
158 * [blocksize_1] = read 4 bits as unsigned integer | Not Used 158 * [blocksize_1] = read 4 bits as unsigned integer | Not Used
159 * [framing_flag] = read one bit | Not Used 159 * [framing_flag] = read one bit | Not Used
160 * */ 160 * */
161 161
162 struct oggvorbis_private {
163 unsigned int len[3];
164 unsigned char *packet[3];
165 };
166
167
168 static unsigned int 162 static unsigned int
169 fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv, 163 fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv,
170 uint8_t **buf) 164 uint8_t **buf)
171 { 165 {
172 int i,offset, len; 166 int i,offset, len;
173 unsigned char *ptr; 167 unsigned char *ptr;
174 168
175 len = priv->len[0] + priv->len[1] + priv->len[2]; 169 len = priv->len[0] + priv->len[1] + priv->len[2];
176 ptr = *buf = av_mallocz(len + len/255 + 64); 170 ptr = *buf = av_mallocz(len + len/255 + 64);
177 171
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 267 }
274 268
275 return 1; 269 return 1;
276 } 270 }
277 271
278 const struct ogg_codec ff_vorbis_codec = { 272 const struct ogg_codec ff_vorbis_codec = {
279 .magic = "\001vorbis", 273 .magic = "\001vorbis",
280 .magicsize = 7, 274 .magicsize = 7,
281 .header = vorbis_header 275 .header = vorbis_header
282 }; 276 };
OLDNEW
« no previous file with comments | « libavformat/oggparsetheora.c ('k') | libavformat/utils.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698