[easytag/easytag-2-2] Simplify reading artwork description from Ogg tags



commit 69c6af1eeaf8bcdea358c55e39d1cc34be7e7415
Author: David King <amigadave amigadave com>
Date:   Thu Dec 18 17:43:32 2014 +0000

    Simplify reading artwork description from Ogg tags

 src/ogg_tag.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/ogg_tag.c b/src/ogg_tag.c
index 365d99b..9e94af8 100644
--- a/src/ogg_tag.c
+++ b/src/ogg_tag.c
@@ -578,14 +578,9 @@ et_add_file_tags_from_vorbis_comments (vorbis_comment *vc, File_Tag *FileTag,
         desclen = read_guint32_from_byte (decoded_ustr, bytes_pos);
         bytes_pos += 4;
 
-        pic->description = g_malloc (desclen + 1);
+        pic->description = g_strndup ((const gchar *)&decoded_ustr[bytes_pos],
+                                      desclen);
 
-        for (i = 0; i < desclen; i++)
-        {
-            pic->description [i] = decoded_ustr [i + bytes_pos];
-        }
-
-        pic->description [desclen] = '\0';
         bytes_pos += desclen + 16;
 
         /* Reading picture size */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]