[brasero/gnome-2-28] One more safety test not to get a negative value for the position in the stream
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero/gnome-2-28] One more safety test not to get a negative value for the position in the stream
- Date: Mon, 28 Sep 2009 12:55:23 +0000 (UTC)
commit 7742fa509abede72e6eb2a28175833e4243299c0
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon Sep 28 14:50:26 2009 +0200
One more safety test not to get a negative value for the position in the stream
That will avoid an infinite loop in some rare cases.
libbrasero-utils/brasero-metadata.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libbrasero-utils/brasero-metadata.c b/libbrasero-utils/brasero-metadata.c
index 875852d..92577bf 100644
--- a/libbrasero-utils/brasero-metadata.c
+++ b/libbrasero-utils/brasero-metadata.c
@@ -435,9 +435,12 @@ brasero_metadata_thumbnail (BraseroMetadata *self)
/* find the right position and move forward */
position = 15 * GST_SECOND;
- while (position >= priv->info->len)
+ while (position > 0 && position >= priv->info->len)
position -= 5 * GST_SECOND;
+ if (position <= 0)
+ return FALSE;
+
gst_element_set_state (priv->pipeline, GST_STATE_PAUSED);
priv->snapshot_started = 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]