diff options
author | Max Kellermann <max@duempel.org> | 2013-12-14 12:50:51 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-14 12:50:51 +0100 |
commit | fbf677d9b2a8e46280d1f22f21c8dd051aeea987 (patch) | |
tree | fd39ce21be1e3da733d24b86d4103d7cd710dc42 | |
parent | d37b788ea81e4b282e3f24aa5cad31d85229cc30 (diff) | |
download | mpd-fbf677d9b2a8e46280d1f22f21c8dd051aeea987.tar.gz mpd-fbf677d9b2a8e46280d1f22f21c8dd051aeea987.tar.xz mpd-fbf677d9b2a8e46280d1f22f21c8dd051aeea987.zip |
decoder/mad: use new[] instead of g_malloc()
Diffstat (limited to '')
-rw-r--r-- | src/decoder/MadDecoderPlugin.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx index 1bf193993..76eead96d 100644 --- a/src/decoder/MadDecoderPlugin.cxx +++ b/src/decoder/MadDecoderPlugin.cxx @@ -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; |