Update of /cvsroot/gtkpod/libgpod/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv18676/src

Modified Files:
        db-artwork-parser.c db-artwork-writer.c itdb_itunesdb.c 
Log Message:
        * src/db-artwork-writer.c (write_mhni): fix segfault caused by
          wrong access of enum inside Itdb_DB



Index: db-artwork-parser.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/db-artwork-parser.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- db-artwork-parser.c 30 May 2006 14:09:42 -0000      1.19
+++ db-artwork-parser.c 1 Jun 2006 13:31:11 -0000       1.20
@@ -335,7 +335,7 @@
                        g_free (mhod_ctx);
                        mhod_ctx = db_parse_context_get_sub_context (ctx, 
cur_offset);
                }
-       ctx->db->db.photodb->photos = g_list_append 
(ctx->db->db.photodb->photos, artwork);
+               ctx->db->db.photodb->photos = g_list_append 
(ctx->db->db.photodb->photos, artwork);
                break;
        case DB_TYPE_ITUNES:
 #ifdef NOT_DEFINED_DEBUG_ARTWORKDB
@@ -387,7 +387,7 @@
 
        dump_mhba (mhba);
 
-    photo_album = g_new0 (Itdb_PhotoAlbum, 1);
+       photo_album = g_new0 (Itdb_PhotoAlbum, 1);
        photo_album->num_images = get_gint32( mhba->num_mhias, ctx->byte_order);
        photo_album->album_id = get_gint32( mhba->playlist_id, ctx->byte_order);
        photo_album->master = get_gint32( mhba->master, ctx->byte_order);
@@ -419,7 +419,7 @@
                g_free (mhia_ctx);
                mhia_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
        }
-    ctx->db->db.photodb->photoalbums = g_list_append 
(ctx->db->db.photodb->photoalbums, photo_album);
+       ctx->db->db.photodb->photoalbums = g_list_append 
(ctx->db->db.photodb->photoalbums, photo_album);
        return 0;
 }
 

Index: db-artwork-writer.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/db-artwork-writer.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- db-artwork-writer.c 30 May 2006 14:09:43 -0000      1.17
+++ db-artwork-writer.c 1 Jun 2006 13:31:11 -0000       1.18
@@ -453,7 +453,8 @@
        mhni->ithmb_offset                      = get_gint32 (thumb->offset, 
buffer->byte_order);
 
        /* Work out the image padding */
-    format = itdb_device_get_artwork_formats (db->db.photodb->device);
+       format = itdb_device_get_artwork_formats (db_get_device (db));
+        g_return_val_if_fail (format, 0);
        while( format->type != thumb->type && format->type != -1 )
                format++;
        mhni->vertical_padding = get_gint16 (

Index: itdb_itunesdb.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/itdb_itunesdb.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- itdb_itunesdb.c     30 May 2006 14:09:43 -0000      1.58
+++ itdb_itunesdb.c     1 Jun 2006 13:31:11 -0000       1.59
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-05-30 21:59:40 jcs>
+/* Time-stamp: <2006-06-01 22:09:17 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -4821,13 +4821,11 @@
 
     switch (db->db_type) {
     case DB_TYPE_ITUNES:
-               g_return_val_if_fail (db->db.itdb->device, NULL);
                return db->db.itdb->device;
     case DB_TYPE_PHOTO:
-               g_return_val_if_fail (db->db.photodb->device, NULL);
                return db->db.photodb->device;
     }
-       return NULL;
+    g_return_val_if_reached (NULL);
 }
 
 



_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to