From 7087fdf6c0d2beb021bb2de59cb5ddfd28cc425e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 19 Aug 2014 20:43:43 +0200 Subject: decoder/DsdLib: make variables more local --- src/decoder/plugins/DsdLib.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/decoder/plugins/DsdLib.cxx') 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; -- cgit v1.2.3