From: Nicholas P. <nic...@ni...> - 2005-11-27 17:31:56
|
Hi, Took me a few hours to narrow down, but this patch prevents a semi-random segfault for me: Index: src/ithumb-writer.c =================================================================== RCS file: /cvsroot/gtkpod/libgpod/src/ithumb-writer.c,v retrieving revision 1.5 diff -u -b -B -w -p -r1.5 ithumb-writer.c --- src/ithumb-writer.c 23 Nov 2005 18:21:52 -0000 1.5 +++ src/ithumb-writer.c 27 Nov 2005 17:29:03 -0000 @@ -106,6 +106,7 @@ itdb_image_dup (Itdb_Image *image) result->width = image->width; result->offset = image->offset; result->size = image->size; + result->filename = g_strdup(image->filename); return result; } @@ -136,10 +137,8 @@ ithumb_writer_write_thumbnail (iThumbWri g_free (image); return NULL; } - g_object_get (G_OBJECT (thumb), - "height", &image->height, - "width", &image->width, - NULL); + image->width = writer->img_info->width; + image->height = writer->img_info->height; image->offset = writer->cur_offset; image->type = writer->img_info->type; image->size = writer->img_info->width * writer->img_info->height * 2; The important part is removing the g_object_get(). I'm assuming the image is the correct size instead of finding why that call overwrites some other memory: we assume it in calculating the size etc. anyway so this isn't worse. The patch to itdb_image_dup is needed to allow many songs to use the same artwork. Nick -- Nick Piper, Developer, LogicaCMG http://www.nickpiper.co.uk/ GPG Encrypted mail welcome! 1024D/3ED8B27F Choose life. Be Vegan :-) Please reduce needless cruelty + suffering ! |