Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
fbf677d9
Commit
fbf677d9
authored
Dec 14, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: use new[] instead of g_malloc()
parent
d37b788e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
MadDecoderPlugin.cxx
src/decoder/MadDecoderPlugin.cxx
+9
-9
No files found.
src/decoder/MadDecoderPlugin.cxx
View file @
fbf677d9
...
...
@@ -32,17 +32,17 @@
#include "util/Domain.hxx"
#include "Log.hxx"
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <mad.h>
#ifdef HAVE_ID3TAG
#include <id3tag.h>
#endif
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define FRAMES_CUSHION 2000
#define READ_BUFFER_SIZE 40960
...
...
@@ -349,14 +349,14 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag)
id3_data
=
stream
.
this_frame
;
mad_stream_skip
(
&
(
stream
),
tagsize
);
}
else
{
allocated
=
(
id3_byte_t
*
)
g_malloc
(
tagsize
)
;
allocated
=
new
id3_byte_t
[
tagsize
]
;
memcpy
(
allocated
,
stream
.
this_frame
,
count
);
mad_stream_skip
(
&
(
stream
),
count
);
if
(
!
decoder_read_full
(
decoder
,
input_stream
,
allocated
+
count
,
tagsize
-
count
))
{
LogDebug
(
mad_domain
,
"error parsing ID3 tag"
);
g_free
(
allocated
)
;
delete
[]
allocated
;
return
;
}
...
...
@@ -365,7 +365,7 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag)
id3_tag
=
id3_tag_parse
(
id3_data
,
tagsize
);
if
(
id3_tag
==
nullptr
)
{
g_free
(
allocated
)
;
delete
[]
allocated
;
return
;
}
...
...
@@ -390,7 +390,7 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag)
id3_tag_delete
(
id3_tag
);
g_free
(
allocated
)
;
delete
[]
allocated
;
#else
/* !HAVE_ID3TAG */
(
void
)
mpd_tag
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment