From 0f0282ae958409f87b0da99d4f0664cee0d76afa Mon Sep 17 00:00:00 2001 From: Jorg Schuler Date: Fri, 1 Jun 2007 13:56:32 +0000 Subject: * src/db-artwork-parser.c (parse_mhba): non-zero terminated string was copied using g_strdup() instead of g_strndup(). This affected album names of the Photo Database. src/db-artwork-writer.c (write_mhod_type_1): convert 'type' as 16 bit integer, not 32 bit integer. Potential problem on non-standard endian system (iPod side). src/db-itunes-parser.h: '#if 0' unused structure to avoid confusion. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1514 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/db-artwork-parser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/db-artwork-parser.c') diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c index 7b84327..9d3c05d 100644 --- a/src/db-artwork-parser.c +++ b/src/db-artwork-parser.c @@ -355,15 +355,17 @@ parse_mhba (DBParseContext *ctx, GError *error) mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset); num_children = get_gint32 (mhba->num_mhods, ctx->byte_order); while ((num_children > 0) && (mhod_ctx != NULL)) { + MhodHeaderArtworkType1 *mhod1; /* FIXME: First mhod is album name, whats the others for? */ mhod = db_parse_context_get_m_header (mhod_ctx, ArtworkDB_MhodHeader, "mhod"); if (mhod == NULL) { return -1; } db_parse_context_set_total_len (mhod_ctx, get_gint32(mhod->total_len, ctx->byte_order)); - album->name = g_strdup( (char *)((MhodHeaderArtworkType1*)mhod)->string ); + mhod1 = (MhodHeaderArtworkType1*)mhod; + album->name = g_strndup ((gchar *)mhod1->string, mhod1->string_len); cur_offset += mhod_ctx->total_len; - dump_mhod_type_1 ((MhodHeaderArtworkType1*)mhod); + dump_mhod_type_1 (mhod1); g_free (mhod_ctx); num_children--; } -- cgit