aft: Avoid invalid read.
[paraslash.git] / opus_afh.c
index 53419243657e4d0e219d362693de0c55c52a2d5d..dca6cfbad1ce3ff8cdf6d820b01bf33bf9a02110 100644 (file)
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2012 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2012 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file opus_afh.c Audio format handler for ogg/opus files. */
 
 
 /** \file opus_afh.c Audio format handler for ogg/opus files. */
 
@@ -295,14 +291,15 @@ static void opus_get_header(void *map, size_t mapsize, char **buf,
 }
 
 /**
 }
 
 /**
- * The init function of the ogg/opus audio format handler.
+ * The audio format handler for ogg/opus.
  *
  *
- * \param afh Pointer to the struct to initialize.
+ * The opus codec was standardized by the Internet Engineering Task Force and
+ * is described in RFC 6716 (2012). The audio format handler depends on the ogg
+ * and the opus libraries.
  */
  */
-void opus_afh_init(struct audio_format_handler *afh)
-{
-       afh->get_file_info = opus_get_file_info,
-       afh->get_header = opus_get_header;
-       afh->suffixes = opus_suffixes;
-       afh->rewrite_tags = opus_rewrite_tags;
-}
+const struct audio_format_handler opus_afh = {
+       .get_file_info = opus_get_file_info,
+       .get_header = opus_get_header,
+       .suffixes = opus_suffixes,
+       .rewrite_tags = opus_rewrite_tags,
+};