diff options
author | Max Kellermann <max@duempel.org> | 2014-08-19 20:43:43 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-19 20:44:29 +0200 |
commit | 7087fdf6c0d2beb021bb2de59cb5ddfd28cc425e (patch) | |
tree | 7c4e3b07d0ad99a574373f473ee932c7232e8a70 /src/decoder/plugins/DsdLib.cxx | |
parent | 67093a51435ba8bec1bc3d34b46d8f89504ce1c2 (diff) | |
download | mpd-7087fdf6c0d2beb021bb2de59cb5ddfd28cc425e.tar.gz mpd-7087fdf6c0d2beb021bb2de59cb5ddfd28cc425e.tar.xz mpd-7087fdf6c0d2beb021bb2de59cb5ddfd28cc425e.zip |
decoder/DsdLib: make variables more local
Diffstat (limited to 'src/decoder/plugins/DsdLib.cxx')
-rw-r--r-- | src/decoder/plugins/DsdLib.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx index 6cabf944d..2f873bac9 100644 --- a/src/decoder/plugins/DsdLib.cxx +++ b/src/decoder/plugins/DsdLib.cxx @@ -115,29 +115,23 @@ dsdlib_tag_id3(InputStream &is, if (!dsdlib_skip_to(nullptr, is, tagoffset)) return; - struct id3_tag *id3_tag = nullptr; - id3_length_t count; - /* Prevent broken files causing problems */ const auto size = is.GetSize(); const auto offset = is.GetOffset(); if (offset >= size) return; - count = size - offset; + const id3_length_t count = size - offset; /* Check and limit id3 tag size to prevent a stack overflow */ id3_byte_t dsdid3[4096]; if (count == 0 || count > sizeof(dsdid3)) return; - id3_byte_t *dsdid3data; - dsdid3data = dsdid3; - - if (!decoder_read_full(nullptr, is, dsdid3data, count)) + if (!decoder_read_full(nullptr, is, dsdid3, count)) return; - id3_tag = id3_tag_parse(dsdid3data, count); + struct id3_tag *id3_tag = id3_tag_parse(dsdid3, count); if (id3_tag == nullptr) return; |