0001-323-Segmentation-fault-when-opening-ipod.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 8dc5015ae036b219c4c9579a156886aa3a722aa5 Mon Sep 17 00:00:00 2001
  2. From: phantomjinx <p.g.richardson@phantomjinx.co.uk>
  3. Date: Sat, 9 Aug 2014 19:57:10 +0100
  4. Subject: [PATCH] #323 Segmentation fault when opening ipod
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. * Patch submitted in bug report from François Melchior / James Burton
  9. ---
  10. src/itdb_itunesdb.c | 6 ++++--
  11. 1 file changed, 4 insertions(+), 2 deletions(-)
  12. diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
  13. index 4cc771a..1e85476 100644
  14. --- a/src/itdb_itunesdb.c
  15. +++ b/src/itdb_itunesdb.c
  16. @@ -1156,6 +1156,7 @@ static gboolean playcounts_plist_read (FImport *fimp, GValue *plist_data)
  17. GHashTable *pc_dict, *track_dict;
  18. GValue *to_parse;
  19. GArray *array;
  20. + GValue value;
  21. gint i;
  22. guint32 mac_time;
  23. guint64 *dbid;
  24. @@ -1175,11 +1176,12 @@ static gboolean playcounts_plist_read (FImport *fimp, GValue *plist_data)
  25. array = (GArray*)g_value_get_boxed (to_parse);
  26. for (i = 0; i < array->len; i++) {
  27. - if (!G_VALUE_HOLDS (g_array_index (array, GValue *, i), G_TYPE_HASH_TABLE)) {
  28. + value = g_array_index (array, GValue, i);
  29. + if (!G_VALUE_HOLDS (&value, G_TYPE_HASH_TABLE)) {
  30. continue;
  31. }
  32. - track_dict = g_value_get_boxed (g_array_index (array, GValue *, i));
  33. + track_dict = g_value_get_boxed (&value);
  34. if (track_dict == NULL)
  35. continue;
  36. --
  37. 2.12.2