diff options
author | Max Kellermann <max@duempel.org> | 2015-01-29 22:55:18 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-29 22:55:18 +0100 |
commit | 557bee61d57287827fb972e859ee454ac920a2a9 (patch) | |
tree | 7cf39a248df95bacb28c810f58913a664f30ee7b /src/decoder | |
parent | 8bfb88840b6ca28a7d3c155099aee905de529300 (diff) | |
parent | 3adca3c2fa21c4062aff62872b8f7f71d7cffe3e (diff) | |
download | mpd-557bee61d57287827fb972e859ee454ac920a2a9.tar.gz mpd-557bee61d57287827fb972e859ee454ac920a2a9.tar.xz mpd-557bee61d57287827fb972e859ee454ac920a2a9.zip |
Merge branch 'v0.19.x'
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/DsdLib.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx index c5df5beec..0b006a71d 100644 --- a/src/decoder/plugins/DsdLib.cxx +++ b/src/decoder/plugins/DsdLib.cxx @@ -125,27 +125,26 @@ dsdlib_tag_id3(InputStream &is, const id3_length_t count = size - offset; - if (count < 10 || count > 256*1024) + if (count < 10 || count > 1024 * 1024) return; - id3_byte_t *const id3_buf = static_cast<id3_byte_t*>(xalloc(count)); + id3_byte_t *const id3_buf = new id3_byte_t[count]; + if (id3_buf == nullptr) + return; if (!decoder_read_full(nullptr, is, id3_buf, count)) { - free(id3_buf); + delete[] id3_buf; return; } struct id3_tag *id3_tag = id3_tag_parse(id3_buf, count); - if (id3_tag == nullptr) { - free(id3_buf); + delete[] id3_buf; + if (id3_tag == nullptr) return; - } scan_id3_tag(id3_tag, handler, handler_ctx); id3_tag_delete(id3_tag); - - free(id3_buf); return; } #endif |