From fbf677d9b2a8e46280d1f22f21c8dd051aeea987 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Dec 2013 12:50:51 +0100 Subject: decoder/mad: use new[] instead of g_malloc() --- src/decoder/MadDecoderPlugin.cxx | 18 +++++++++--------- 1 file 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 -#include -#include -#include -#include #include #ifdef HAVE_ID3TAG #include #endif +#include +#include +#include +#include + #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; -- cgit v1.2.3