brasero r2213 - in trunk: . libbrasero-media
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r2213 - in trunk: . libbrasero-media
- Date: Mon, 6 Apr 2009 13:49:23 +0000 (UTC)
Author: philippr
Date: Mon Apr 6 13:49:23 2009
New Revision: 2213
URL: http://svn.gnome.org/viewvc/brasero?rev=2213&view=rev
Log:
2009-04-06 Philippe Rouquier <bonfire-app wanadoo fr>
Try to fix #573929 â nautilus crashed with SIGSEGV in start_thread()
Comment #9
* libbrasero-media/brasero-medium.c
(brasero_medium_get_speed_mmc3),
(brasero_medium_get_page_2A_write_speed_desc):
Modified:
trunk/ChangeLog
trunk/libbrasero-media/brasero-medium.c
Modified: trunk/libbrasero-media/brasero-medium.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium.c (original)
+++ trunk/libbrasero-media/brasero-medium.c Mon Apr 6 13:49:23 2009
@@ -1193,7 +1193,7 @@
BraseroDeviceHandle *handle,
BraseroScsiErrCode *code)
{
- int size;
+ int size = 0;
int num_desc, i;
gint max_rd, max_wrt;
BraseroScsiResult result;
@@ -1216,10 +1216,13 @@
return FALSE;
}
- num_desc = (size - sizeof (BraseroScsiGetPerfHdr)) /
- sizeof (BraseroScsiWrtSpdDesc);
+ /* choose the smallest value for size */
+ size = MIN (size, BRASERO_GET_32 (wrt_perf->hdr.len) + sizeof (wrt_perf->hdr.len));
+
+ /* calculate the number of descriptors */
+ num_desc = (size - sizeof (BraseroScsiGetPerfHdr)) / sizeof (BraseroScsiWrtSpdDesc);
- if (num_desc <= 0)
+ if (num_desc <= 0)
goto end;
priv->rd_speeds = g_new0 (gint, num_desc + 1);
@@ -1229,9 +1232,9 @@
max_wrt = 0;
desc = (BraseroScsiWrtSpdDesc*) &wrt_perf->data;
- for (i = 0; i < num_desc; i ++, desc ++) {
- priv->rd_speeds [i] = BRASERO_GET_32 (desc->rd_speed);
- priv->wr_speeds [i] = BRASERO_GET_32 (desc->wr_speed);
+ for (i = 0; i < num_desc; i ++) {
+ priv->rd_speeds [i] = BRASERO_GET_32 (desc [i].rd_speed);
+ priv->wr_speeds [i] = BRASERO_GET_32 (desc [i].wr_speed);
max_rd = MAX (max_rd, priv->rd_speeds [i]);
max_wrt = MAX (max_wrt, priv->wr_speeds [i]);
@@ -1286,7 +1289,7 @@
page_2A = (BraseroScsiStatusPage *) &data->page;
/* Reminder: size = sizeof (BraseroScsiStatusPage) + sizeof (BraseroScsiModeHdr) */
- size = MIN (sizeof (data->hdr.len) + BRASERO_GET_16 (data->hdr.len), size);
+ size = MIN (size, sizeof (data->hdr.len) + BRASERO_GET_16 (data->hdr.len));
if (size < (G_STRUCT_OFFSET (BraseroScsiStatusPage, copy_mngt_rev) +
sizeof (BraseroScsiModeHdr))) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]