21 lines
1 KiB
Diff
21 lines
1 KiB
Diff
--- vorbis_header_utils.c.orig Fri Aug 31 14:47:55 2007
|
|
+++ vorbis_header_utils.c Fri Aug 31 14:51:23 2007
|
|
@@ -153,15 +153,15 @@
|
|
die("malloc");
|
|
|
|
memcpy(new_vc, vc, sizeof(vorbis_comment));
|
|
- new_vc->user_comments = (char **)malloc((vc->comments + 1) * sizeof(char *));
|
|
- new_vc->comment_lengths = (int *)malloc((vc->comments + 1) * sizeof(int));
|
|
+ new_vc->user_comments = (char **)malloc((vc->comments + 1) * sizeof(*new_vc->user_comments));
|
|
+ new_vc->comment_lengths = (int *)malloc((vc->comments + 1) * sizeof(*new_vc->comment_lengths));
|
|
if ((new_vc->user_comments == NULL) || (new_vc->comment_lengths == NULL))
|
|
die("malloc");
|
|
for (i = 0; i < vc->comments; i++)
|
|
new_vc->user_comments[i] = strdup(vc->user_comments[i]);
|
|
new_vc->user_comments[vc->comments] = 0;
|
|
memcpy(new_vc->comment_lengths, vc->comment_lengths,
|
|
- (vc->comments + 1) * sizeof(char *));
|
|
+ (vc->comments + 1) * sizeof(*new_vc->comment_lengths));
|
|
new_vc->vendor = strdup(vc->vendor);
|
|
|
|
return new_vc;
|