diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
index 188f15083..c005c6a88 100644
--- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
@@ -201,10 +201,11 @@ dsdiff_handle_native_tag(InputStream &is,
 	uint32_t length = FromBE32(metatag.size);
 
 	/* Check and limit size of the tag to prevent a stack overflow */
-	if (length == 0 || length > 60)
+	constexpr size_t MAX_LENGTH = 60;
+	if (length == 0 || length > MAX_LENGTH)
 		return;
 
-	char string[length + 1];
+	char string[MAX_LENGTH + 1];
 	char *label;
 	label = string;