[brasero/gnome-2-30] Try again to fix #606010 - crashes at audio CD insertion
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero/gnome-2-30] Try again to fix #606010 - crashes at audio CD insertion
- Date: Mon, 19 Jul 2010 12:01:57 +0000 (UTC)
commit f031e1ee921886ef2a0f50a936cf939a9d614463
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon Jul 19 14:01:01 2010 +0200
Try again to fix #606010 - crashes at audio CD insertion
libbrasero-media/brasero-medium.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libbrasero-media/brasero-medium.c b/libbrasero-media/brasero-medium.c
index 80c41ef..a8e24f8 100644
--- a/libbrasero-media/brasero-medium.c
+++ b/libbrasero-media/brasero-medium.c
@@ -2791,10 +2791,14 @@ brasero_medium_read_CD_TEXT (BraseroMedium *self,
return;
}
- /* Get the number of CD-Text Data Packs */
- num = (BRASERO_GET_16 (cd_text->hdr->len) -
- (sizeof (BraseroScsiTocPmaAtipHdr) - sizeof (cd_text->hdr->len))) /
- sizeof (BraseroScsiCDTextPackData);
+ /* Get the number of CD-Text Data Packs.
+ * Some drives seem to report an idiotic cd_text->hdr->len. So use size
+ * to be on the safe side. */
+ num = (size - sizeof (BraseroScsiTocPmaAtipHdr)) / sizeof (BraseroScsiCDTextPackData);
+ if (num <= 0) {
+ g_free (cd_text);
+ return;
+ }
priv = BRASERO_MEDIUM_PRIVATE (self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]